From e87e64f10bf5e21200657e3c01bf7c815cf279db Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Tue, 1 Sep 2020 19:48:02 +0300 Subject: [PATCH 01/21] it compiles --- cmd/rpcdaemon/commands/daemon.go | 26 ++ cmd/rpcdaemon/commands/eth_api.go | 3 +- cmd/rpcdaemon/commands/get_receipts.go | 308 +++++++++++++++++++++- core/eth_backend.go | 6 + core/rawdb/accessors_chain.go | 19 ++ ethdb/kv_abstract.go | 1 + ethdb/kv_remote.go | 5 + ethdb/remote/ethbackend.pb.go | 138 ++++++++-- ethdb/remote/ethbackend.proto | 10 + ethdb/remote/ethbackend_grpc.pb.go | 36 +++ ethdb/remote/remotedbserver/ethbackend.go | 7 + 11 files changed, 534 insertions(+), 25 deletions(-) diff --git a/cmd/rpcdaemon/commands/daemon.go b/cmd/rpcdaemon/commands/daemon.go index f4fa954700a..c05ceaa9174 100644 --- a/cmd/rpcdaemon/commands/daemon.go +++ b/cmd/rpcdaemon/commands/daemon.go @@ -4,7 +4,9 @@ import ( "context" "fmt" "github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/cli" + "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/core/rawdb" + "github.com/ledgerwatch/turbo-geth/core/types" "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/rpc" "github.com/ledgerwatch/turbo-geth/turbo/adapter/ethapi" @@ -32,6 +34,30 @@ func (api *APIImpl) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber return response, err } +func (api *APIImpl) GetBlockByHash(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) { + header := rawdb.ReadHeaderByNumber(api.dbReader, uint64(number.Int64())) + + return api.GetBlockByNumber(ctx, rpc.BlockNumber(header.Number.Int64()), fullTx) +} + +func (api *APIImpl) GetHeaderByNumber(_ context.Context, number rpc.BlockNumber) (*types.Header, error) { + header := rawdb.ReadHeaderByNumber(api.dbReader, uint64(number.Int64())) + if header == nil { + return nil, fmt.Errorf("block header not found: %d", number.Int64()) + } + + return header, nil +} + +func (api *APIImpl) GetHeaderByHash(_ context.Context, hash common.Hash) (*types.Header, error) { + header := rawdb.ReadHeaderByHash(api.dbReader, hash) + if header == nil { + return nil, fmt.Errorf("block header not found: %s", hash.String()) + } + + return header, nil +} + func APIList(db ethdb.KV, eth ethdb.Backend, cfg cli.Flags, customApiList []rpc.API) []rpc.API { var defaultAPIList []rpc.API diff --git a/cmd/rpcdaemon/commands/eth_api.go b/cmd/rpcdaemon/commands/eth_api.go index 607f35056ea..85e97454ba9 100644 --- a/cmd/rpcdaemon/commands/eth_api.go +++ b/cmd/rpcdaemon/commands/eth_api.go @@ -2,6 +2,7 @@ package commands import ( "context" + ethereum "github.com/ledgerwatch/turbo-geth" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" "github.com/ledgerwatch/turbo-geth/core" @@ -19,7 +20,7 @@ type EthAPI interface { GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) - GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) + GetLogs(ctx context.Context, crit ethereum.FilterQuery) ([]*types.Log, error) Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *map[common.Address]ethapi.Account) (hexutil.Bytes, error) EstimateGas(ctx context.Context, args ethapi.CallArgs) (hexutil.Uint64, error) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error) diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 6f19c2f9d7d..1690b9ff2b5 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -2,10 +2,15 @@ package commands import ( "context" + "errors" "fmt" + "math/big" + + "github.com/ledgerwatch/turbo-geth/core/bloombits" "github.com/ledgerwatch/turbo-geth/turbo/adapter" "github.com/ledgerwatch/turbo-geth/turbo/transactions" + ethereum "github.com/ledgerwatch/turbo-geth" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" "github.com/ledgerwatch/turbo-geth/core" @@ -14,6 +19,7 @@ import ( "github.com/ledgerwatch/turbo-geth/core/vm" "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/params" + "github.com/ledgerwatch/turbo-geth/rpc" ) func GetReceipts(ctx context.Context, db rawdb.DatabaseReader, cfg *params.ChainConfig, hash common.Hash) (types.Receipts, error) { @@ -51,7 +57,7 @@ func GetReceipts(ctx context.Context, db rawdb.DatabaseReader, cfg *params.Chain return receipts, nil } -func (api *APIImpl) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) { +func (api *APIImpl) GetLogsByHash(ctx context.Context, hash common.Hash) ([][]*types.Log, error) { number := rawdb.ReadHeaderNumber(api.dbReader, hash) if number == nil { return nil, fmt.Errorf("block not found: %x", hash) @@ -68,6 +74,92 @@ func (api *APIImpl) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.L return logs, nil } +// Filter can be used to retrieve and filter logs. +type Filter struct { + addresses []common.Address + topics [][]common.Hash + + block common.Hash // Block hash if filtering a single block + begin, end int64 // Range interval if filtering multiple blocks + + matcher *bloombits.Matcher +} + +func NewBlockFilter(block common.Hash, addresses []common.Address, topics [][]common.Hash) *Filter { + // Create a generic filter and convert it into a block filter + filter := newFilter(addresses, topics) + filter.block = block + return filter +} + +// newFilter creates a generic filter that can either filter based on a block hash, +// or based on range queries. The search criteria needs to be explicitly set. +func newFilter(addresses []common.Address, topics [][]common.Hash) *Filter { + return &Filter{ + addresses: addresses, + topics: topics, + } +} + +// GetLogs returns logs matching the given argument that are stored within the state. +func (api *APIImpl) GetLogs(ctx context.Context, crit ethereum.FilterQuery) ([]*types.Log, error) { + var filter *Filter + if crit.BlockHash != nil { + // Block filter requested, construct a single-shot filter + filter = NewBlockFilter(*crit.BlockHash, crit.Addresses, crit.Topics) + } else { + // Convert the RPC block numbers into internal representations + begin := rpc.LatestBlockNumber.Int64() + if crit.FromBlock != nil { + begin = crit.FromBlock.Int64() + } + end := rpc.LatestBlockNumber.Int64() + if crit.ToBlock != nil { + end = crit.ToBlock.Int64() + } + // Construct the range filter + filter = NewRangeFilter(begin, end, crit.Addresses, crit.Topics) + } + // Run the filter and return all the logs + logs, err := filter.Logs(ctx, api) + if err != nil { + return nil, err + } + return returnLogs(logs), err +} + +// NewRangeFilter creates a new filter which uses a bloom filter on blocks to +// figure out whether a particular block is interesting or not. +func NewRangeFilter(begin, end int64, addresses []common.Address, topics [][]common.Hash) *Filter { + // Flatten the address and topic filter clauses into a single bloombits filter + // system. Since the bloombits are not positional, nil topics are permitted, + // which get flattened into a nil byte slice. + var filters [][][]byte + if len(addresses) > 0 { + filter := make([][]byte, len(addresses)) + for i, address := range addresses { + filter[i] = address.Bytes() + } + filters = append(filters, filter) + } + for _, topicList := range topics { + filter := make([][]byte, len(topicList)) + for i, topic := range topicList { + filter[i] = topic.Bytes() + } + filters = append(filters, filter) + } + + // Create a generic filter and convert it into a range filter + filter := newFilter(addresses, topics) + + filter.matcher = bloombits.NewMatcher(params.BloomBitsBlocks, filters) + filter.begin = begin + filter.end = end + + return filter +} + func (api *APIImpl) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) { // Retrieve the transaction and assemble its EVM context tx, blockHash, blockNumber, txIndex := rawdb.ReadTransaction(api.dbReader, hash) @@ -131,3 +223,217 @@ func (api *APIImpl) GetTransactionReceipt(ctx context.Context, hash common.Hash) } return fields, nil } + +// Logs searches the blockchain for matching log entries, returning all from the +// first block that contains matches, updating the start of the filter accordingly. +func (f *Filter) Logs(ctx context.Context, api *APIImpl) ([]*types.Log, error) { + // If we're doing singleton block filtering, execute and return + if f.block != (common.Hash{}) { + header, err := api.GetHeaderByHash(ctx, f.block) + if err != nil { + return nil, err + } + if header == nil { + return nil, errors.New("unknown block") + } + return f.blockLogs(ctx, header, api) + } + + // Figure out the limits of the filter range + // FIXME: read latest block number + header, _ := api.GetHeaderByNumber(ctx, rpc.LatestBlockNumber) + if header == nil { + return nil, nil + } + head := header.Number.Uint64() + + if f.begin == -1 { + f.begin = int64(head) + } + end := uint64(f.end) + if f.end == -1 { + end = head + } + + // Gather all indexed logs, and finish with non indexed ones + var logs []*types.Log + var err error + size, sections, _ := api.ethBackend.BloomStatus() + + if indexed := sections * size; indexed > uint64(f.begin) { + if indexed > end { + logs, err = f.indexedLogs(ctx, end, api) + } else { + logs, err = f.indexedLogs(ctx, indexed-1, api) + } + if err != nil { + return logs, err + } + } + rest, err := f.unindexedLogs(ctx, end, api) + logs = append(logs, rest...) + return logs, err +} + +// indexedLogs returns the logs matching the filter criteria based on the bloom +// bits indexed available locally or via the network. +func (f *Filter) indexedLogs(ctx context.Context, end uint64, api *APIImpl) ([]*types.Log, error) { + // Iterate over the matches until exhausted or context closed + var logs []*types.Log + + for num := f.begin; num < int64(end)+1; num++ { + // Retrieve the suggested block and pull any truly matching logs + header, err := api.GetHeaderByNumber(ctx, rpc.BlockNumber(num)) + if header == nil || err != nil { + return logs, err + } + found, err := f.checkMatches(ctx, header, api) + if err != nil { + return logs, err + } + logs = append(logs, found...) + } + + return logs, nil +} + +// unindexedLogs returns the logs matching the filter criteria based on raw block +// iteration and bloom matching. +func (f *Filter) unindexedLogs(ctx context.Context, end uint64, api *APIImpl) ([]*types.Log, error) { + var logs []*types.Log + + for ; f.begin <= int64(end); f.begin++ { + header, err := api.GetHeaderByNumber(ctx, rpc.BlockNumber(f.begin)) + if header == nil || err != nil { + return logs, err + } + found, err := f.blockLogs(ctx, header, api) + if err != nil { + return logs, err + } + logs = append(logs, found...) + } + return logs, nil +} + +// blockLogs returns the logs matching the filter criteria within a single block. +func (f *Filter) blockLogs(ctx context.Context, header *types.Header, api *APIImpl) (logs []*types.Log, err error) { + if bloomFilter(header.Bloom, f.addresses, f.topics) { + found, err := f.checkMatches(ctx, header, api) + if err != nil { + return logs, err + } + logs = append(logs, found...) + } + return logs, nil +} + +// checkMatches checks if the receipts belonging to the given header contain any log events that +// match the filter criteria. This function is called when the bloom filter signals a potential match. +func (f *Filter) checkMatches(ctx context.Context, header *types.Header, api *APIImpl) (logs []*types.Log, err error) { + // Get the logs of the block + logsList, err := api.GetLogsByHash(ctx, header.Hash()) + if err != nil { + return nil, err + } + var unfiltered []*types.Log + for _, logs := range logsList { + unfiltered = append(unfiltered, logs...) + } + logs = filterLogs(unfiltered, nil, nil, f.addresses, f.topics) + if len(logs) > 0 { + // We have matching logs, check if we need to resolve full logs via the light client + if logs[0].TxHash == (common.Hash{}) { + receipts := rawdb.ReadReceipts(api.dbReader, header.Hash(), header.Number.Uint64(), params.MainnetChainConfig) + unfiltered = unfiltered[:0] + for _, receipt := range receipts { + unfiltered = append(unfiltered, receipt.Logs...) + } + logs = filterLogs(unfiltered, nil, nil, f.addresses, f.topics) + } + return logs, nil + } + return nil, nil +} + +func includes(addresses []common.Address, a common.Address) bool { + for _, addr := range addresses { + if addr == a { + return true + } + } + + return false +} + +// filterLogs creates a slice of logs matching the given criteria. +func filterLogs(logs []*types.Log, fromBlock, toBlock *big.Int, addresses []common.Address, topics [][]common.Hash) []*types.Log { + var ret []*types.Log +Logs: + for _, log := range logs { + if fromBlock != nil && fromBlock.Int64() >= 0 && fromBlock.Uint64() > log.BlockNumber { + continue + } + if toBlock != nil && toBlock.Int64() >= 0 && toBlock.Uint64() < log.BlockNumber { + continue + } + + if len(addresses) > 0 && !includes(addresses, log.Address) { + continue + } + // If the to filtered topics is greater than the amount of topics in logs, skip. + if len(topics) > len(log.Topics) { + continue Logs + } + for i, sub := range topics { + match := len(sub) == 0 // empty rule set == wildcard + for _, topic := range sub { + if log.Topics[i] == topic { + match = true + break + } + } + if !match { + continue Logs + } + } + ret = append(ret, log) + } + return ret +} + +func bloomFilter(bloom types.Bloom, addresses []common.Address, topics [][]common.Hash) bool { + if len(addresses) > 0 { + var included bool + for _, addr := range addresses { + if types.BloomLookup(bloom, addr) { + included = true + break + } + } + if !included { + return false + } + } + + for _, sub := range topics { + included := len(sub) == 0 // empty rule set == wildcard + for _, topic := range sub { + if types.BloomLookup(bloom, topic) { + included = true + break + } + } + if !included { + return false + } + } + return true +} + +func returnLogs(logs []*types.Log) []*types.Log { + if logs == nil { + return []*types.Log{} + } + return logs +} diff --git a/core/eth_backend.go b/core/eth_backend.go index 579b73ee8e1..df9c1baa2fb 100644 --- a/core/eth_backend.go +++ b/core/eth_backend.go @@ -14,6 +14,7 @@ type Backend interface { TxPool() *TxPool Etherbase() (common.Address, error) NetVersion() (uint64, error) + BloomIndexer() *ChainIndexer } func NewEthBackend(eth Backend) *EthBackend { @@ -28,3 +29,8 @@ func (back *EthBackend) AddLocal(signedtx []byte) ([]byte, error) { return tx.Hash().Bytes(), back.TxPool().AddLocal(tx) } + + +func (back *EthBackend) BloomStatus() (uint64, uint64, common.Hash) { + return back.Backend.BloomIndexer().Sections() +} diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 1a214472a15..a0f193039df 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -588,6 +588,25 @@ func ReadBlockByHash(db DatabaseReader, hash common.Hash) *types.Block { return ReadBlock(db, hash, *number) } + + +func ReadHeaderByNumber(db DatabaseReader, number uint64) *types.Header { + hash := ReadCanonicalHash(db, number) + if hash == (common.Hash{}) { + return nil + } + + return ReadHeader(db, hash, number) +} + +func ReadHeaderByHash(db DatabaseReader, hash common.Hash) *types.Header { + number := ReadHeaderNumber(db, hash) + if number == nil { + return nil + } + return ReadHeader(db, hash, *number) +} + // FIXME: implement in Turbo-Geth // WriteAncientBlock writes entire block data into ancient store and returns the total written size. func WriteAncientBlock(db DatabaseWriter, block *types.Block, receipts types.Receipts, td *big.Int) int { diff --git a/ethdb/kv_abstract.go b/ethdb/kv_abstract.go index dc97fbdaa63..0a1ed3f2b35 100644 --- a/ethdb/kv_abstract.go +++ b/ethdb/kv_abstract.go @@ -72,6 +72,7 @@ type Backend interface { AddLocal([]byte) ([]byte, error) Etherbase() (common.Address, error) NetVersion() (uint64, error) + BloomStatus() (uint64, uint64, common.Hash) } type DbProvider uint8 diff --git a/ethdb/kv_remote.go b/ethdb/kv_remote.go index 6109f74239a..572d73a81ac 100644 --- a/ethdb/kv_remote.go +++ b/ethdb/kv_remote.go @@ -389,3 +389,8 @@ func (back *RemoteBackend) NetVersion() (uint64, error) { return res.Id, nil } + +func (back *RemoteBackend) BloomStatus() (uint64, uint64, common.Hash) { + res, _ := back.remoteEthBackend.BloomStatus(context.Background(), &remote.BloomStatusRequest{}) + return res.Size, res.Sections, common.BytesToHash(res.Hash) +} diff --git a/ethdb/remote/ethbackend.pb.go b/ethdb/remote/ethbackend.pb.go index 9732c427c28..dd32b989ab8 100644 --- a/ethdb/remote/ethbackend.pb.go +++ b/ethdb/remote/ethbackend.pb.go @@ -98,6 +98,92 @@ func (m *AddReply) GetHash() []byte { return nil } +type BloomStatusRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BloomStatusRequest) Reset() { *m = BloomStatusRequest{} } +func (m *BloomStatusRequest) String() string { return proto.CompactTextString(m) } +func (*BloomStatusRequest) ProtoMessage() {} +func (*BloomStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4527a6acc4e6161e, []int{2} +} + +func (m *BloomStatusRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BloomStatusRequest.Unmarshal(m, b) +} +func (m *BloomStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BloomStatusRequest.Marshal(b, m, deterministic) +} +func (m *BloomStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BloomStatusRequest.Merge(m, src) +} +func (m *BloomStatusRequest) XXX_Size() int { + return xxx_messageInfo_BloomStatusRequest.Size(m) +} +func (m *BloomStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BloomStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BloomStatusRequest proto.InternalMessageInfo + +type BloomStatusReply struct { + Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + Sections uint64 `protobuf:"varint,2,opt,name=sections,proto3" json:"sections,omitempty"` + Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BloomStatusReply) Reset() { *m = BloomStatusReply{} } +func (m *BloomStatusReply) String() string { return proto.CompactTextString(m) } +func (*BloomStatusReply) ProtoMessage() {} +func (*BloomStatusReply) Descriptor() ([]byte, []int) { + return fileDescriptor_4527a6acc4e6161e, []int{3} +} + +func (m *BloomStatusReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BloomStatusReply.Unmarshal(m, b) +} +func (m *BloomStatusReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BloomStatusReply.Marshal(b, m, deterministic) +} +func (m *BloomStatusReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_BloomStatusReply.Merge(m, src) +} +func (m *BloomStatusReply) XXX_Size() int { + return xxx_messageInfo_BloomStatusReply.Size(m) +} +func (m *BloomStatusReply) XXX_DiscardUnknown() { + xxx_messageInfo_BloomStatusReply.DiscardUnknown(m) +} + +var xxx_messageInfo_BloomStatusReply proto.InternalMessageInfo + +func (m *BloomStatusReply) GetSize() uint64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *BloomStatusReply) GetSections() uint64 { + if m != nil { + return m.Sections + } + return 0 +} + +func (m *BloomStatusReply) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + type EtherbaseRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -108,7 +194,7 @@ func (m *EtherbaseRequest) Reset() { *m = EtherbaseRequest{} } func (m *EtherbaseRequest) String() string { return proto.CompactTextString(m) } func (*EtherbaseRequest) ProtoMessage() {} func (*EtherbaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{2} + return fileDescriptor_4527a6acc4e6161e, []int{4} } func (m *EtherbaseRequest) XXX_Unmarshal(b []byte) error { @@ -140,7 +226,7 @@ func (m *EtherbaseReply) Reset() { *m = EtherbaseReply{} } func (m *EtherbaseReply) String() string { return proto.CompactTextString(m) } func (*EtherbaseReply) ProtoMessage() {} func (*EtherbaseReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{3} + return fileDescriptor_4527a6acc4e6161e, []int{5} } func (m *EtherbaseReply) XXX_Unmarshal(b []byte) error { @@ -178,7 +264,7 @@ func (m *NetVersionRequest) Reset() { *m = NetVersionRequest{} } func (m *NetVersionRequest) String() string { return proto.CompactTextString(m) } func (*NetVersionRequest) ProtoMessage() {} func (*NetVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{4} + return fileDescriptor_4527a6acc4e6161e, []int{6} } func (m *NetVersionRequest) XXX_Unmarshal(b []byte) error { @@ -210,7 +296,7 @@ func (m *NetVersionReply) Reset() { *m = NetVersionReply{} } func (m *NetVersionReply) String() string { return proto.CompactTextString(m) } func (*NetVersionReply) ProtoMessage() {} func (*NetVersionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{5} + return fileDescriptor_4527a6acc4e6161e, []int{7} } func (m *NetVersionReply) XXX_Unmarshal(b []byte) error { @@ -241,6 +327,8 @@ func (m *NetVersionReply) GetId() uint64 { func init() { proto.RegisterType((*TxRequest)(nil), "remote.TxRequest") proto.RegisterType((*AddReply)(nil), "remote.AddReply") + proto.RegisterType((*BloomStatusRequest)(nil), "remote.BloomStatusRequest") + proto.RegisterType((*BloomStatusReply)(nil), "remote.BloomStatusReply") proto.RegisterType((*EtherbaseRequest)(nil), "remote.EtherbaseRequest") proto.RegisterType((*EtherbaseReply)(nil), "remote.EtherbaseReply") proto.RegisterType((*NetVersionRequest)(nil), "remote.NetVersionRequest") @@ -250,23 +338,27 @@ func init() { func init() { proto.RegisterFile("remote/ethbackend.proto", fileDescriptor_4527a6acc4e6161e) } var fileDescriptor_4527a6acc4e6161e = []byte{ - // 278 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x51, 0x4b, 0xc3, 0x30, - 0x14, 0x85, 0xe9, 0x1c, 0x63, 0xbb, 0xc8, 0xd6, 0x45, 0x70, 0xb3, 0x0f, 0xa2, 0x45, 0x50, 0x04, - 0x33, 0xd4, 0x47, 0x11, 0x6c, 0xb5, 0x20, 0x08, 0x43, 0xca, 0xf0, 0xc1, 0xb7, 0xc6, 0x5c, 0x96, - 0xe0, 0x6c, 0x6a, 0x92, 0xc1, 0xf6, 0xd3, 0xfc, 0x77, 0xb2, 0x76, 0xad, 0x45, 0xeb, 0x53, 0x92, - 0x73, 0xee, 0x17, 0xce, 0xe1, 0xc2, 0x48, 0xe3, 0x87, 0xb2, 0x38, 0x41, 0x2b, 0x58, 0xf2, 0xf6, - 0x8e, 0x29, 0xa7, 0x99, 0x56, 0x56, 0x91, 0x4e, 0x61, 0xf8, 0xa7, 0xd0, 0x9b, 0xad, 0x62, 0xfc, - 0x5c, 0xa2, 0xb1, 0xc4, 0x83, 0xae, 0x91, 0xf3, 0x14, 0xb9, 0x5d, 0x8d, 0x9d, 0x23, 0xe7, 0x6c, - 0x37, 0xae, 0xde, 0xfe, 0x21, 0x74, 0x03, 0xce, 0x63, 0xcc, 0x16, 0x6b, 0x42, 0xa0, 0x2d, 0x12, - 0x23, 0xb6, 0x33, 0xf9, 0xdd, 0x27, 0xe0, 0x46, 0x56, 0xa0, 0x66, 0x89, 0xc1, 0xed, 0x7f, 0xfe, - 0x09, 0xf4, 0x6b, 0xda, 0x7f, 0xe4, 0x1e, 0x0c, 0xa7, 0x68, 0x5f, 0x50, 0x1b, 0xa9, 0xd2, 0x12, - 0x3d, 0x86, 0x41, 0x5d, 0xdc, 0xb0, 0x7d, 0x68, 0x49, 0x9e, 0x93, 0xed, 0xb8, 0x25, 0xf9, 0xd5, - 0x97, 0x03, 0x10, 0xcd, 0x1e, 0xc3, 0xe0, 0xfe, 0x29, 0x9a, 0x3e, 0x90, 0x73, 0xd8, 0x09, 0x38, - 0x27, 0x43, 0x5a, 0x34, 0xa3, 0x55, 0x2d, 0xcf, 0x2d, 0xa5, 0xaa, 0xc0, 0x2d, 0xf4, 0xaa, 0x60, - 0x64, 0x5c, 0xda, 0xbf, 0xf3, 0x7b, 0xfb, 0x0d, 0xce, 0x06, 0xbf, 0x03, 0xf8, 0x09, 0x47, 0x0e, - 0xca, 0xa9, 0x3f, 0x2d, 0xbc, 0x51, 0x93, 0x95, 0x2d, 0xd6, 0xe1, 0x25, 0xb8, 0x52, 0x51, 0xbb, - 0xd4, 0x4c, 0x5d, 0xcc, 0xd1, 0x0a, 0xca, 0x59, 0x58, 0x2b, 0xf3, 0xec, 0xbc, 0x0e, 0xe8, 0xa4, - 0x60, 0x6f, 0x8a, 0x83, 0x75, 0xf2, 0xc5, 0x5d, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x74, 0xfd, - 0x74, 0x87, 0xd3, 0x01, 0x00, 0x00, + // 337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcf, 0x4b, 0xf3, 0x40, + 0x14, 0x24, 0x6d, 0x29, 0xed, 0xfb, 0x3e, 0xda, 0x74, 0x15, 0x1b, 0x73, 0x10, 0x0d, 0x82, 0x22, + 0x98, 0xa2, 0x1e, 0x45, 0xb0, 0xa9, 0x05, 0x41, 0x28, 0x12, 0x4b, 0x0f, 0xde, 0x92, 0xee, 0xa3, + 0x59, 0x6c, 0xb3, 0x35, 0xfb, 0x0a, 0xad, 0x7f, 0xbc, 0x48, 0xf3, 0xcb, 0x68, 0xe3, 0x29, 0xbb, + 0x33, 0x6f, 0x76, 0x26, 0xb3, 0x0b, 0xdd, 0x08, 0x17, 0x92, 0xb0, 0x87, 0x14, 0xf8, 0xde, 0xf4, + 0x0d, 0x43, 0x6e, 0x2f, 0x23, 0x49, 0x92, 0xd5, 0x13, 0xc2, 0x3a, 0x83, 0xe6, 0x78, 0xed, 0xe2, + 0xfb, 0x0a, 0x15, 0x31, 0x13, 0x1a, 0x4a, 0xcc, 0x42, 0xe4, 0xb4, 0x36, 0xb4, 0x63, 0xed, 0xfc, + 0xbf, 0x9b, 0xef, 0xad, 0x23, 0x68, 0xf4, 0x39, 0x77, 0x71, 0x39, 0xdf, 0x30, 0x06, 0xb5, 0xc0, + 0x53, 0x41, 0x3a, 0x13, 0xaf, 0xad, 0x7d, 0x60, 0xce, 0x5c, 0xca, 0xc5, 0x0b, 0x79, 0xb4, 0x52, + 0xe9, 0x89, 0xd6, 0x04, 0xf4, 0x1f, 0x68, 0xaa, 0x56, 0xe2, 0x03, 0x63, 0x75, 0xcd, 0x8d, 0xd7, + 0xb1, 0x33, 0x4e, 0x49, 0xc8, 0x50, 0x19, 0x95, 0x18, 0xcf, 0xf7, 0xb9, 0x5b, 0xb5, 0xe0, 0xc6, + 0x40, 0x1f, 0x52, 0x80, 0x91, 0xef, 0x29, 0xcc, 0xbc, 0x4e, 0xa1, 0x55, 0xc0, 0xfe, 0xca, 0xb9, + 0x07, 0x9d, 0x11, 0xd2, 0x04, 0x23, 0x25, 0x64, 0x98, 0x49, 0x4f, 0xa0, 0x5d, 0x04, 0xb7, 0xda, + 0x16, 0x54, 0x04, 0x4f, 0x33, 0x56, 0x04, 0xbf, 0xfe, 0xd4, 0x00, 0x86, 0xe3, 0x47, 0xa7, 0x3f, + 0x78, 0x1a, 0x8e, 0x1e, 0xd8, 0x05, 0x54, 0xfb, 0x9c, 0xb3, 0x8e, 0x9d, 0xf4, 0x68, 0xe7, 0x25, + 0x9a, 0x7a, 0x06, 0xe5, 0x75, 0xdd, 0x41, 0x33, 0x0f, 0xc6, 0x8c, 0x8c, 0xfe, 0x9d, 0xdf, 0x3c, + 0x28, 0x61, 0xb6, 0xf2, 0x7b, 0x80, 0xef, 0x70, 0xec, 0x30, 0x9b, 0xda, 0xf9, 0x0b, 0xb3, 0x5b, + 0x46, 0x6d, 0x4f, 0x18, 0xc0, 0xbf, 0xc2, 0x2d, 0x30, 0x33, 0x9b, 0xdb, 0xbd, 0x30, 0xd3, 0x28, + 0xe5, 0x96, 0xf3, 0x8d, 0x73, 0x05, 0xba, 0x90, 0x36, 0xad, 0x22, 0x5f, 0x5e, 0xce, 0x90, 0x02, + 0x9b, 0xfb, 0x4e, 0xa1, 0x91, 0x67, 0xed, 0xb5, 0x6d, 0xf7, 0x12, 0xf1, 0x6d, 0xf2, 0xf1, 0xeb, + 0xf1, 0x5b, 0xbb, 0xf9, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xa7, 0x70, 0x03, 0x86, 0x02, 0x00, + 0x00, } diff --git a/ethdb/remote/ethbackend.proto b/ethdb/remote/ethbackend.proto index 5fd3feb0d29..f7edd6e133b 100644 --- a/ethdb/remote/ethbackend.proto +++ b/ethdb/remote/ethbackend.proto @@ -11,6 +11,7 @@ service ETHBACKEND { rpc Add(TxRequest) returns (AddReply); rpc Etherbase(EtherbaseRequest) returns (EtherbaseReply); rpc NetVersion(NetVersionRequest) returns (NetVersionReply); + rpc BloomStatus(BloomStatusRequest) returns (BloomStatusReply); } message TxRequest { @@ -21,6 +22,15 @@ message AddReply { bytes hash = 1; } +message BloomStatusRequest { +} + +message BloomStatusReply { + uint64 size = 1; + uint64 sections = 2; + bytes hash = 3; +} + message EtherbaseRequest { } diff --git a/ethdb/remote/ethbackend_grpc.pb.go b/ethdb/remote/ethbackend_grpc.pb.go index 1878f650ebc..b0d376e81f4 100644 --- a/ethdb/remote/ethbackend_grpc.pb.go +++ b/ethdb/remote/ethbackend_grpc.pb.go @@ -20,6 +20,7 @@ type ETHBACKENDClient interface { Add(ctx context.Context, in *TxRequest, opts ...grpc.CallOption) (*AddReply, error) Etherbase(ctx context.Context, in *EtherbaseRequest, opts ...grpc.CallOption) (*EtherbaseReply, error) NetVersion(ctx context.Context, in *NetVersionRequest, opts ...grpc.CallOption) (*NetVersionReply, error) + BloomStatus(ctx context.Context, in *BloomStatusRequest, opts ...grpc.CallOption) (*BloomStatusReply, error) } type eTHBACKENDClient struct { @@ -57,6 +58,15 @@ func (c *eTHBACKENDClient) NetVersion(ctx context.Context, in *NetVersionRequest return out, nil } +func (c *eTHBACKENDClient) BloomStatus(ctx context.Context, in *BloomStatusRequest, opts ...grpc.CallOption) (*BloomStatusReply, error) { + out := new(BloomStatusReply) + err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/BloomStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ETHBACKENDServer is the server API for ETHBACKEND service. // All implementations must embed UnimplementedETHBACKENDServer // for forward compatibility @@ -64,6 +74,7 @@ type ETHBACKENDServer interface { Add(context.Context, *TxRequest) (*AddReply, error) Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) + BloomStatus(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) mustEmbedUnimplementedETHBACKENDServer() } @@ -80,6 +91,9 @@ func (*UnimplementedETHBACKENDServer) Etherbase(context.Context, *EtherbaseReque func (*UnimplementedETHBACKENDServer) NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) { return nil, status.Errorf(codes.Unimplemented, "method NetVersion not implemented") } +func (*UnimplementedETHBACKENDServer) BloomStatus(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BloomStatus not implemented") +} func (*UnimplementedETHBACKENDServer) mustEmbedUnimplementedETHBACKENDServer() {} func RegisterETHBACKENDServer(s *grpc.Server, srv ETHBACKENDServer) { @@ -140,6 +154,24 @@ func _ETHBACKEND_NetVersion_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _ETHBACKEND_BloomStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BloomStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ETHBACKENDServer).BloomStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/remote.ETHBACKEND/BloomStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ETHBACKENDServer).BloomStatus(ctx, req.(*BloomStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ETHBACKEND_serviceDesc = grpc.ServiceDesc{ ServiceName: "remote.ETHBACKEND", HandlerType: (*ETHBACKENDServer)(nil), @@ -156,6 +188,10 @@ var _ETHBACKEND_serviceDesc = grpc.ServiceDesc{ MethodName: "NetVersion", Handler: _ETHBACKEND_NetVersion_Handler, }, + { + MethodName: "BloomStatus", + Handler: _ETHBACKEND_BloomStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "remote/ethbackend.proto", diff --git a/ethdb/remote/remotedbserver/ethbackend.go b/ethdb/remote/remotedbserver/ethbackend.go index 085b55c3c75..9eb0e391de1 100644 --- a/ethdb/remote/remotedbserver/ethbackend.go +++ b/ethdb/remote/remotedbserver/ethbackend.go @@ -7,6 +7,7 @@ import ( "github.com/ledgerwatch/turbo-geth/core" "github.com/ledgerwatch/turbo-geth/core/types" "github.com/ledgerwatch/turbo-geth/ethdb/remote" + "github.com/ledgerwatch/turbo-geth/params" "github.com/ledgerwatch/turbo-geth/rlp" ) @@ -55,3 +56,9 @@ func (s *EthBackendServer) NetVersion(_ context.Context, _ *remote.NetVersionReq } return &remote.NetVersionReply{Id: id}, nil } + +func (s *EthBackendServer) BloomStatus(_ context.Context, _ *remote.BloomStatusRequest) (*remote.BloomStatusReply, error) { + sections, _, _ := s.eth.BloomIndexer().Sections() + + return &remote.BloomStatusReply{Size: params.BloomBitsBlocks, Sections: sections}, nil +} From 18f6b8a3948fb059187e1344b5b0001725f766db Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Tue, 1 Sep 2020 20:22:44 +0300 Subject: [PATCH 02/21] after recent master --- cmd/rpcdaemon/commands/daemon.go | 15 +++-------- cmd/rpcdaemon/commands/eth_api.go | 15 +++-------- cmd/rpcdaemon/commands/get_receipts.go | 22 ++++++++-------- cmd/rpcdaemon/commands/rpc_block.go | 35 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 cmd/rpcdaemon/commands/rpc_block.go diff --git a/cmd/rpcdaemon/commands/daemon.go b/cmd/rpcdaemon/commands/daemon.go index 4174b8af951..9b3f83b8c80 100644 --- a/cmd/rpcdaemon/commands/daemon.go +++ b/cmd/rpcdaemon/commands/daemon.go @@ -8,7 +8,6 @@ import ( "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" "github.com/ledgerwatch/turbo-geth/core/rawdb" - "github.com/ledgerwatch/turbo-geth/eth/stagedsync/stages" "github.com/ledgerwatch/turbo-geth/core/types" "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/rpc" @@ -18,17 +17,9 @@ import ( // GetBlockByNumber see https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbynumber // see internal/ethapi.PublicBlockChainAPI.GetBlockByNumber func (api *APIImpl) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) { - var blockNum uint64 - if number == rpc.LatestBlockNumber || number == rpc.PendingBlockNumber { - var err error - blockNum, _, err = stages.GetStageProgress(api.dbReader, stages.Execution) - if err != nil { - return nil, fmt.Errorf("getting latest block number: %v", err) - } - } else if number == rpc.EarliestBlockNumber { - blockNum = 0 - } else { - blockNum = uint64(number.Int64()) + blockNum, err := getBlockNumber(number, api.dbReader) + if err != nil { + return nil, err } additionalFields := make(map[string]interface{}) diff --git a/cmd/rpcdaemon/commands/eth_api.go b/cmd/rpcdaemon/commands/eth_api.go index 760e44af8d8..963ea01641e 100644 --- a/cmd/rpcdaemon/commands/eth_api.go +++ b/cmd/rpcdaemon/commands/eth_api.go @@ -84,18 +84,11 @@ func (api *APIImpl) Syncing(ctx context.Context) (interface{}, error) { } func (api *APIImpl) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error) { - var blockNum uint64 - if blockNr == rpc.LatestBlockNumber || blockNr == rpc.PendingBlockNumber { - var err error - blockNum, _, err = stages.GetStageProgress(api.dbReader, stages.Execution) - if err != nil { - return nil, fmt.Errorf("getting latest block number: %v", err) - } - } else if blockNr == rpc.EarliestBlockNumber { - blockNum = 0 - } else { - blockNum = uint64(blockNr.Int64()) + blockNum, err := getBlockNumber(blockNr, api.dbReader) + if err != nil { + return nil, err } + block := rawdb.ReadBlockByNumber(api.dbReader, blockNum) if block == nil { return nil, fmt.Errorf("block not found: %d", blockNum) diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 1690b9ff2b5..1bba2fe8dda 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -109,11 +109,16 @@ func (api *APIImpl) GetLogs(ctx context.Context, crit ethereum.FilterQuery) ([]* filter = NewBlockFilter(*crit.BlockHash, crit.Addresses, crit.Topics) } else { // Convert the RPC block numbers into internal representations - begin := rpc.LatestBlockNumber.Int64() + latest, err := getLatestBlockNumber(api.dbReader) + if err != nil { + return nil, err + } + + begin := int64(latest) if crit.FromBlock != nil { begin = crit.FromBlock.Int64() } - end := rpc.LatestBlockNumber.Int64() + end := int64(latest) if crit.ToBlock != nil { end = crit.ToBlock.Int64() } @@ -240,24 +245,21 @@ func (f *Filter) Logs(ctx context.Context, api *APIImpl) ([]*types.Log, error) { } // Figure out the limits of the filter range - // FIXME: read latest block number - header, _ := api.GetHeaderByNumber(ctx, rpc.LatestBlockNumber) - if header == nil { - return nil, nil + latest, err := getLatestBlockNumber(api.dbReader) + if err != nil { + return nil, err } - head := header.Number.Uint64() if f.begin == -1 { - f.begin = int64(head) + f.begin = int64(latest) } end := uint64(f.end) if f.end == -1 { - end = head + end = latest } // Gather all indexed logs, and finish with non indexed ones var logs []*types.Log - var err error size, sections, _ := api.ethBackend.BloomStatus() if indexed := sections * size; indexed > uint64(f.begin) { diff --git a/cmd/rpcdaemon/commands/rpc_block.go b/cmd/rpcdaemon/commands/rpc_block.go new file mode 100644 index 00000000000..f2cc821c012 --- /dev/null +++ b/cmd/rpcdaemon/commands/rpc_block.go @@ -0,0 +1,35 @@ +package commands + +import ( + "fmt" + + "github.com/ledgerwatch/turbo-geth/eth/stagedsync/stages" + "github.com/ledgerwatch/turbo-geth/ethdb" + "github.com/ledgerwatch/turbo-geth/rpc" +) + +func getBlockNumber(number rpc.BlockNumber, dbReader ethdb.Getter) (uint64, error) { + var blockNum uint64 + var err error + if number == rpc.LatestBlockNumber || number == rpc.PendingBlockNumber { + blockNum, err = getLatestBlockNumber(dbReader) + if err != nil { + return 0, err + } + } else if number == rpc.EarliestBlockNumber { + blockNum = 0 + } else { + blockNum = uint64(number.Int64()) + } + + return blockNum, nil +} + +func getLatestBlockNumber(dbReader ethdb.Getter) (uint64, error) { + blockNum, _, err := stages.GetStageProgress(dbReader, stages.Execution) + if err != nil { + return 0, fmt.Errorf("getting latest block number: %v", err) + } + + return blockNum, nil +} From 39756b2e156b541509d748c2e8ee379522dcc10e Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 11:05:18 +0300 Subject: [PATCH 03/21] fix linters warnings --- cmd/rpcdaemon/commands/eth_api.go | 2 +- cmd/rpcdaemon/commands/get_receipts.go | 4 ++-- cmd/rpcdaemon/commands/rpc_block.go | 6 +++--- core/eth_backend.go | 1 - core/rawdb/accessors_chain.go | 2 -- go.mod | 3 +++ go.sum | 22 ++++++++++++++++++++++ 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/cmd/rpcdaemon/commands/eth_api.go b/cmd/rpcdaemon/commands/eth_api.go index 963ea01641e..23ed49968fa 100644 --- a/cmd/rpcdaemon/commands/eth_api.go +++ b/cmd/rpcdaemon/commands/eth_api.go @@ -2,8 +2,8 @@ package commands import ( "context" - ethereum "github.com/ledgerwatch/turbo-geth" "fmt" + ethereum "github.com/ledgerwatch/turbo-geth" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 1bba2fe8dda..a0b38f66c48 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -139,7 +139,7 @@ func NewRangeFilter(begin, end int64, addresses []common.Address, topics [][]com // Flatten the address and topic filter clauses into a single bloombits filter // system. Since the bloombits are not positional, nil topics are permitted, // which get flattened into a nil byte slice. - var filters [][][]byte + filters := make([][][]byte, 0, len(addresses)) if len(addresses) > 0 { filter := make([][]byte, len(addresses)) for i, address := range addresses { @@ -338,7 +338,7 @@ func (f *Filter) checkMatches(ctx context.Context, header *types.Header, api *AP if err != nil { return nil, err } - var unfiltered []*types.Log + unfiltered := make([]*types.Log, 0, len(logsList)) for _, logs := range logsList { unfiltered = append(unfiltered, logs...) } diff --git a/cmd/rpcdaemon/commands/rpc_block.go b/cmd/rpcdaemon/commands/rpc_block.go index f2cc821c012..d5cca45f313 100644 --- a/cmd/rpcdaemon/commands/rpc_block.go +++ b/cmd/rpcdaemon/commands/rpc_block.go @@ -3,12 +3,12 @@ package commands import ( "fmt" + "github.com/ledgerwatch/turbo-geth/core/rawdb" "github.com/ledgerwatch/turbo-geth/eth/stagedsync/stages" - "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/rpc" ) -func getBlockNumber(number rpc.BlockNumber, dbReader ethdb.Getter) (uint64, error) { +func getBlockNumber(number rpc.BlockNumber, dbReader rawdb.DatabaseReader) (uint64, error) { var blockNum uint64 var err error if number == rpc.LatestBlockNumber || number == rpc.PendingBlockNumber { @@ -25,7 +25,7 @@ func getBlockNumber(number rpc.BlockNumber, dbReader ethdb.Getter) (uint64, erro return blockNum, nil } -func getLatestBlockNumber(dbReader ethdb.Getter) (uint64, error) { +func getLatestBlockNumber(dbReader rawdb.DatabaseReader) (uint64, error) { blockNum, _, err := stages.GetStageProgress(dbReader, stages.Execution) if err != nil { return 0, fmt.Errorf("getting latest block number: %v", err) diff --git a/core/eth_backend.go b/core/eth_backend.go index df9c1baa2fb..fcd975cdc1e 100644 --- a/core/eth_backend.go +++ b/core/eth_backend.go @@ -30,7 +30,6 @@ func (back *EthBackend) AddLocal(signedtx []byte) ([]byte, error) { return tx.Hash().Bytes(), back.TxPool().AddLocal(tx) } - func (back *EthBackend) BloomStatus() (uint64, uint64, common.Hash) { return back.Backend.BloomIndexer().Sections() } diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index a0f193039df..03b3fbf469d 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -588,8 +588,6 @@ func ReadBlockByHash(db DatabaseReader, hash common.Hash) *types.Block { return ReadBlock(db, hash, *number) } - - func ReadHeaderByNumber(db DatabaseReader, number uint64) *types.Header { hash := ReadCanonicalHash(db, number) if hash == (common.Hash{}) { diff --git a/go.mod b/go.mod index d28c73afbb5..fa5c3c664bc 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/emicklei/dot v0.11.0 github.com/ethereum/evmc/v7 v7.3.0 github.com/fatih/color v1.7.0 + github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff github.com/gin-gonic/gin v1.6.2 github.com/go-ole/go-ole v1.2.4 // indirect @@ -43,6 +44,7 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 github.com/julienschmidt/httprouter v1.2.0 github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 + github.com/kevinburke/go-bindata v3.21.0+incompatible // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 github.com/ledgerwatch/lmdb-go v1.13.1-0.20200829020305-221d50cfedab @@ -76,6 +78,7 @@ require ( golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 google.golang.org/grpc v1.30.1 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe // indirect google.golang.org/protobuf v1.25.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce diff --git a/go.sum b/go.sum index c3fbee5b2fe..313fbceee40 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,12 @@ github.com/ethereum/evmc/v7 v7.3.0 h1:4CsjJ+vSRrkzxOHeG1lFRGk4sG4/PgzXnWuRNgLGMJ github.com/ethereum/evmc/v7 v7.3.0/go.mod h1:q2Q0rCSUlIkngd+mZwfCzEUbvB0IIopH1+7hcs9QuDg= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f h1:Y/gg/utVetS+WS6htAKCTDralkm/8hLIIUAtLFdbdQ8= +github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f/go.mod h1:q+7Z5oyy8cvKF3TakcuihvQvBHFTnXjB+7UP1e2Q+1o= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -182,6 +186,7 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -204,6 +209,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= +github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -214,6 +221,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 h1:8e99Kuxoi+RnWCO8zD+ftp+rIuh9AYkZDRPmO8Xgp5k= @@ -260,6 +268,9 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= @@ -367,6 +378,7 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -375,6 +387,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -392,6 +405,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -418,6 +432,9 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9 h1:m9xhlkk2j+sO9WjAgNfTtl505MN7ZkuW69nOcBlp9qY= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -434,6 +451,9 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.30.1 h1:oJTcovwKSu7V3TaBKd0/AXOuJVHjTdGTutbMHIOgVEQ= google.golang.org/grpc v1.30.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe h1:Wd/jb/cOPNfvxxUAejtru6/krTJyzX6aGV5GY7EcqI0= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -450,11 +470,13 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 07cccf1ba9024e613d36da87753c827cd94d35ea Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 14:36:39 +0300 Subject: [PATCH 04/21] grpcV7 --- ethdb/kv_abstract_test.go | 7 +- ethdb/remote/db.pb.go | 410 +++++++--------------- ethdb/remote/db_grpc.pb.go | 130 ++++--- ethdb/remote/kv.pb.go | 393 ++++++++------------- ethdb/remote/kv_grpc.pb.go | 99 ++++-- ethdb/remote/remotedbserver/db.go | 2 +- ethdb/remote/remotedbserver/ethbackend.go | 2 +- ethdb/remote/remotedbserver/server.go | 29 +- go.mod | 2 +- go.sum | 12 + 10 files changed, 461 insertions(+), 625 deletions(-) diff --git a/ethdb/kv_abstract_test.go b/ethdb/kv_abstract_test.go index eebdd3ab458..9fc7c517df6 100644 --- a/ethdb/kv_abstract_test.go +++ b/ethdb/kv_abstract_test.go @@ -108,7 +108,12 @@ func setupDatabases(f ethdb.BucketConfigsFunc) (writeDBs []ethdb.KV, readDBs []e grpcServer := grpc.NewServer() go func() { - remote.RegisterKVServer(grpcServer, remotedbserver.NewKvServer(writeDBs[2])) + kvSrv := remotedbserver.NewKvServer(writeDBs[2]) + kvService := &remote.KVService{ + Seek: kvSrv.Seek, + } + + remote.RegisterKVService(grpcServer, kvService) if err := grpcServer.Serve(conn); err != nil { log.Error("private RPC server fail", "err", err) } diff --git a/ethdb/remote/db.pb.go b/ethdb/remote/db.pb.go index 038af5ccdb3..422b0aba0e4 100644 --- a/ethdb/remote/db.pb.go +++ b/ethdb/remote/db.pb.go @@ -1,337 +1,195 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 // source: remote/db.proto package remote import ( + fmt "fmt" proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + math "math" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type SizeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *SizeRequest) Reset() { - *x = SizeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_db_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *SizeRequest) Reset() { *m = SizeRequest{} } +func (m *SizeRequest) String() string { return proto.CompactTextString(m) } +func (*SizeRequest) ProtoMessage() {} +func (*SizeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ab4915a3c5b6560d, []int{0} } -func (x *SizeRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *SizeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SizeRequest.Unmarshal(m, b) } - -func (*SizeRequest) ProtoMessage() {} - -func (x *SizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_db_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *SizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SizeRequest.Marshal(b, m, deterministic) } - -// Deprecated: Use SizeRequest.ProtoReflect.Descriptor instead. -func (*SizeRequest) Descriptor() ([]byte, []int) { - return file_remote_db_proto_rawDescGZIP(), []int{0} +func (m *SizeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SizeRequest.Merge(m, src) +} +func (m *SizeRequest) XXX_Size() int { + return xxx_messageInfo_SizeRequest.Size(m) +} +func (m *SizeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SizeRequest.DiscardUnknown(m) } -type SizeReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +var xxx_messageInfo_SizeRequest proto.InternalMessageInfo - Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` +type SizeReply struct { + Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *SizeReply) Reset() { - *x = SizeReply{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_db_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *SizeReply) Reset() { *m = SizeReply{} } +func (m *SizeReply) String() string { return proto.CompactTextString(m) } +func (*SizeReply) ProtoMessage() {} +func (*SizeReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ab4915a3c5b6560d, []int{1} } -func (x *SizeReply) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *SizeReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SizeReply.Unmarshal(m, b) } - -func (*SizeReply) ProtoMessage() {} - -func (x *SizeReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_db_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *SizeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SizeReply.Marshal(b, m, deterministic) } - -// Deprecated: Use SizeReply.ProtoReflect.Descriptor instead. -func (*SizeReply) Descriptor() ([]byte, []int) { - return file_remote_db_proto_rawDescGZIP(), []int{1} +func (m *SizeReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SizeReply.Merge(m, src) +} +func (m *SizeReply) XXX_Size() int { + return xxx_messageInfo_SizeReply.Size(m) +} +func (m *SizeReply) XXX_DiscardUnknown() { + xxx_messageInfo_SizeReply.DiscardUnknown(m) } -func (x *SizeReply) GetSize() uint64 { - if x != nil { - return x.Size +var xxx_messageInfo_SizeReply proto.InternalMessageInfo + +func (m *SizeReply) GetSize() uint64 { + if m != nil { + return m.Size } return 0 } type BucketSizeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` + BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *BucketSizeRequest) Reset() { - *x = BucketSizeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_db_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *BucketSizeRequest) Reset() { *m = BucketSizeRequest{} } +func (m *BucketSizeRequest) String() string { return proto.CompactTextString(m) } +func (*BucketSizeRequest) ProtoMessage() {} +func (*BucketSizeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ab4915a3c5b6560d, []int{2} } -func (x *BucketSizeRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *BucketSizeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BucketSizeRequest.Unmarshal(m, b) } - -func (*BucketSizeRequest) ProtoMessage() {} - -func (x *BucketSizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_db_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *BucketSizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BucketSizeRequest.Marshal(b, m, deterministic) } - -// Deprecated: Use BucketSizeRequest.ProtoReflect.Descriptor instead. -func (*BucketSizeRequest) Descriptor() ([]byte, []int) { - return file_remote_db_proto_rawDescGZIP(), []int{2} +func (m *BucketSizeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BucketSizeRequest.Merge(m, src) +} +func (m *BucketSizeRequest) XXX_Size() int { + return xxx_messageInfo_BucketSizeRequest.Size(m) } +func (m *BucketSizeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BucketSizeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BucketSizeRequest proto.InternalMessageInfo -func (x *BucketSizeRequest) GetBucketName() string { - if x != nil { - return x.BucketName +func (m *BucketSizeRequest) GetBucketName() string { + if m != nil { + return m.BucketName } return "" } type BucketSizeReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *BucketSizeReply) Reset() { - *x = BucketSizeReply{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_db_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *BucketSizeReply) Reset() { *m = BucketSizeReply{} } +func (m *BucketSizeReply) String() string { return proto.CompactTextString(m) } +func (*BucketSizeReply) ProtoMessage() {} +func (*BucketSizeReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ab4915a3c5b6560d, []int{3} } -func (x *BucketSizeReply) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *BucketSizeReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BucketSizeReply.Unmarshal(m, b) } - -func (*BucketSizeReply) ProtoMessage() {} - -func (x *BucketSizeReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_db_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *BucketSizeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BucketSizeReply.Marshal(b, m, deterministic) } - -// Deprecated: Use BucketSizeReply.ProtoReflect.Descriptor instead. -func (*BucketSizeReply) Descriptor() ([]byte, []int) { - return file_remote_db_proto_rawDescGZIP(), []int{3} +func (m *BucketSizeReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_BucketSizeReply.Merge(m, src) } - -func (x *BucketSizeReply) GetSize() uint64 { - if x != nil { - return x.Size - } - return 0 +func (m *BucketSizeReply) XXX_Size() int { + return xxx_messageInfo_BucketSizeReply.Size(m) } - -var File_remote_db_proto protoreflect.FileDescriptor - -var file_remote_db_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x69, 0x7a, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1f, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x33, 0x0a, 0x11, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, - 0x0a, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, - 0x0a, 0x0f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x32, 0x76, 0x0a, 0x02, 0x44, 0x42, 0x12, 0x2e, 0x0a, 0x04, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x13, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x69, 0x7a, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x29, 0x0a, - 0x10, 0x69, 0x6f, 0x2e, 0x74, 0x75, 0x72, 0x62, 0x6f, 0x2d, 0x67, 0x65, 0x74, 0x68, 0x2e, 0x64, - 0x62, 0x42, 0x02, 0x44, 0x42, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +func (m *BucketSizeReply) XXX_DiscardUnknown() { + xxx_messageInfo_BucketSizeReply.DiscardUnknown(m) } -var ( - file_remote_db_proto_rawDescOnce sync.Once - file_remote_db_proto_rawDescData = file_remote_db_proto_rawDesc -) +var xxx_messageInfo_BucketSizeReply proto.InternalMessageInfo -func file_remote_db_proto_rawDescGZIP() []byte { - file_remote_db_proto_rawDescOnce.Do(func() { - file_remote_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_remote_db_proto_rawDescData) - }) - return file_remote_db_proto_rawDescData -} - -var file_remote_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_remote_db_proto_goTypes = []interface{}{ - (*SizeRequest)(nil), // 0: remote.SizeRequest - (*SizeReply)(nil), // 1: remote.SizeReply - (*BucketSizeRequest)(nil), // 2: remote.BucketSizeRequest - (*BucketSizeReply)(nil), // 3: remote.BucketSizeReply -} -var file_remote_db_proto_depIdxs = []int32{ - 0, // 0: remote.DB.Size:input_type -> remote.SizeRequest - 2, // 1: remote.DB.BucketSize:input_type -> remote.BucketSizeRequest - 1, // 2: remote.DB.Size:output_type -> remote.SizeReply - 3, // 3: remote.DB.BucketSize:output_type -> remote.BucketSizeReply - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name +func (m *BucketSizeReply) GetSize() uint64 { + if m != nil { + return m.Size + } + return 0 } -func init() { file_remote_db_proto_init() } -func file_remote_db_proto_init() { - if File_remote_db_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_remote_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SizeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SizeReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BucketSizeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BucketSizeReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_remote_db_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_remote_db_proto_goTypes, - DependencyIndexes: file_remote_db_proto_depIdxs, - MessageInfos: file_remote_db_proto_msgTypes, - }.Build() - File_remote_db_proto = out.File - file_remote_db_proto_rawDesc = nil - file_remote_db_proto_goTypes = nil - file_remote_db_proto_depIdxs = nil +func init() { + proto.RegisterType((*SizeRequest)(nil), "remote.SizeRequest") + proto.RegisterType((*SizeReply)(nil), "remote.SizeReply") + proto.RegisterType((*BucketSizeRequest)(nil), "remote.BucketSizeRequest") + proto.RegisterType((*BucketSizeReply)(nil), "remote.BucketSizeReply") +} + +func init() { proto.RegisterFile("remote/db.proto", fileDescriptor_ab4915a3c5b6560d) } + +var fileDescriptor_ab4915a3c5b6560d = []byte{ + // 207 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x4a, 0xcd, 0xcd, + 0x2f, 0x49, 0xd5, 0x4f, 0x49, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0x08, 0x28, + 0xf1, 0x72, 0x71, 0x07, 0x67, 0x56, 0xa5, 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0xc9, + 0x73, 0x71, 0x42, 0xb8, 0x05, 0x39, 0x95, 0x42, 0x42, 0x5c, 0x2c, 0xc5, 0x99, 0x55, 0xa9, 0x12, + 0x8c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x60, 0xb6, 0x92, 0x31, 0x97, 0xa0, 0x53, 0x69, 0x72, 0x76, + 0x6a, 0x09, 0x92, 0x2e, 0x21, 0x39, 0x2e, 0xae, 0x24, 0xb0, 0xa0, 0x5f, 0x62, 0x2e, 0x44, 0x39, + 0x67, 0x10, 0x92, 0x88, 0x92, 0x2a, 0x17, 0x3f, 0xb2, 0x26, 0x1c, 0x66, 0x1b, 0x95, 0x71, 0x31, + 0xb9, 0x38, 0x09, 0xe9, 0x71, 0xb1, 0x80, 0x94, 0x09, 0x09, 0xeb, 0x41, 0x9c, 0xa8, 0x87, 0x64, + 0x93, 0x94, 0x20, 0xaa, 0x20, 0xc8, 0x24, 0x07, 0x2e, 0x2e, 0x84, 0xe1, 0x42, 0x92, 0x30, 0x05, + 0x18, 0xae, 0x94, 0x12, 0xc7, 0x26, 0x55, 0x90, 0x53, 0xe9, 0xa4, 0xc9, 0x25, 0x90, 0x99, 0xaf, + 0x57, 0x52, 0x5a, 0x94, 0x94, 0xaf, 0x9b, 0x9e, 0x5a, 0x92, 0xa1, 0x97, 0x92, 0xe4, 0xc4, 0xe4, + 0xe2, 0x14, 0xc0, 0x18, 0xc5, 0xaf, 0xa7, 0x0f, 0xd1, 0x63, 0x0d, 0xa1, 0x92, 0xd8, 0xc0, 0xa1, + 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x9a, 0xd7, 0x6d, 0x50, 0x01, 0x00, 0x00, } diff --git a/ethdb/remote/db_grpc.pb.go b/ethdb/remote/db_grpc.pb.go index 6aa4788e669..91a799a6457 100644 --- a/ethdb/remote/db_grpc.pb.go +++ b/ethdb/remote/db_grpc.pb.go @@ -11,7 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion7 // DBClient is the client API for DB service. // @@ -29,6 +29,10 @@ func NewDBClient(cc grpc.ClientConnInterface) DBClient { return &dBClient{cc} } +var dBSizeStreamDesc = &grpc.StreamDesc{ + StreamName: "Size", +} + func (c *dBClient) Size(ctx context.Context, in *SizeRequest, opts ...grpc.CallOption) (*SizeReply, error) { out := new(SizeReply) err := c.cc.Invoke(ctx, "/remote.DB/Size", in, out, opts...) @@ -38,6 +42,10 @@ func (c *dBClient) Size(ctx context.Context, in *SizeRequest, opts ...grpc.CallO return out, nil } +var dBBucketSizeStreamDesc = &grpc.StreamDesc{ + StreamName: "BucketSize", +} + func (c *dBClient) BucketSize(ctx context.Context, in *BucketSizeRequest, opts ...grpc.CallOption) (*BucketSizeReply, error) { out := new(BucketSizeReply) err := c.cc.Invoke(ctx, "/remote.DB/BucketSize", in, out, opts...) @@ -47,80 +55,108 @@ func (c *dBClient) BucketSize(ctx context.Context, in *BucketSizeRequest, opts . return out, nil } -// DBServer is the server API for DB service. -// All implementations must embed UnimplementedDBServer -// for forward compatibility -type DBServer interface { - Size(context.Context, *SizeRequest) (*SizeReply, error) - BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) - mustEmbedUnimplementedDBServer() -} - -// UnimplementedDBServer must be embedded to have forward compatible implementations. -type UnimplementedDBServer struct { -} - -func (*UnimplementedDBServer) Size(context.Context, *SizeRequest) (*SizeReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Size not implemented") -} -func (*UnimplementedDBServer) BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method BucketSize not implemented") +// DBService is the service API for DB service. +// Fields should be assigned to their respective handler implementations only before +// RegisterDBService is called. Any unassigned fields will result in the +// handler for that method returning an Unimplemented error. +type DBService struct { + Size func(context.Context, *SizeRequest) (*SizeReply, error) + BucketSize func(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) } -func (*UnimplementedDBServer) mustEmbedUnimplementedDBServer() {} -func RegisterDBServer(s *grpc.Server, srv DBServer) { - s.RegisterService(&_DB_serviceDesc, srv) -} - -func _DB_Size_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func (s *DBService) size(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SizeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DBServer).Size(ctx, in) + return s.Size(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: srv, + Server: s, FullMethod: "/remote.DB/Size", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBServer).Size(ctx, req.(*SizeRequest)) + return s.Size(ctx, req.(*SizeRequest)) } return interceptor(ctx, in, info, handler) } - -func _DB_BucketSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func (s *DBService) bucketSize(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BucketSizeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DBServer).BucketSize(ctx, in) + return s.BucketSize(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: srv, + Server: s, FullMethod: "/remote.DB/BucketSize", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBServer).BucketSize(ctx, req.(*BucketSizeRequest)) + return s.BucketSize(ctx, req.(*BucketSizeRequest)) } return interceptor(ctx, in, info, handler) } -var _DB_serviceDesc = grpc.ServiceDesc{ - ServiceName: "remote.DB", - HandlerType: (*DBServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Size", - Handler: _DB_Size_Handler, - }, - { - MethodName: "BucketSize", - Handler: _DB_BucketSize_Handler, +// RegisterDBService registers a service implementation with a gRPC server. +func RegisterDBService(s grpc.ServiceRegistrar, srv *DBService) { + srvCopy := *srv + if srvCopy.Size == nil { + srvCopy.Size = func(context.Context, *SizeRequest) (*SizeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Size not implemented") + } + } + if srvCopy.BucketSize == nil { + srvCopy.BucketSize = func(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BucketSize not implemented") + } + } + sd := grpc.ServiceDesc{ + ServiceName: "remote.DB", + Methods: []grpc.MethodDesc{ + { + MethodName: "Size", + Handler: srvCopy.size, + }, + { + MethodName: "BucketSize", + Handler: srvCopy.bucketSize, + }, }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "remote/db.proto", + Streams: []grpc.StreamDesc{}, + Metadata: "remote/db.proto", + } + + s.RegisterService(&sd, nil) +} + +// NewDBService creates a new DBService containing the +// implemented methods of the DB service in s. Any unimplemented +// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. +// This includes situations where the method handler is misspelled or has the wrong +// signature. For this reason, this function should be used with great care and +// is not recommended to be used by most users. +func NewDBService(s interface{}) *DBService { + ns := &DBService{} + if h, ok := s.(interface { + Size(context.Context, *SizeRequest) (*SizeReply, error) + }); ok { + ns.Size = h.Size + } + if h, ok := s.(interface { + BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) + }); ok { + ns.BucketSize = h.BucketSize + } + return ns +} + +// UnstableDBService is the service API for DB service. +// New methods may be added to this interface if they are added to the service +// definition, which is not a backward-compatible change. For this reason, +// use of this type is not recommended. +type UnstableDBService interface { + Size(context.Context, *SizeRequest) (*SizeReply, error) + BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) } diff --git a/ethdb/remote/kv.pb.go b/ethdb/remote/kv.pb.go index d64f3299b3d..df1389eab7e 100644 --- a/ethdb/remote/kv.pb.go +++ b/ethdb/remote/kv.pb.go @@ -1,326 +1,207 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 // source: remote/kv.proto package remote import ( + fmt "fmt" proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + math "math" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type SeekRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` - SeekKey []byte `protobuf:"bytes,2,opt,name=seekKey,proto3" json:"seekKey,omitempty"` // streaming start from this key - Prefix []byte `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` // streaming stops when see first key without given prefix - StartSreaming bool `protobuf:"varint,4,opt,name=startSreaming,proto3" json:"startSreaming,omitempty"` + BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` + SeekKey []byte `protobuf:"bytes,2,opt,name=seekKey,proto3" json:"seekKey,omitempty"` + Prefix []byte `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + StartSreaming bool `protobuf:"varint,4,opt,name=startSreaming,proto3" json:"startSreaming,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeekRequest) Reset() { *m = SeekRequest{} } +func (m *SeekRequest) String() string { return proto.CompactTextString(m) } +func (*SeekRequest) ProtoMessage() {} +func (*SeekRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_007925a9984cab2c, []int{0} } -func (x *SeekRequest) Reset() { - *x = SeekRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_kv_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *SeekRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeekRequest.Unmarshal(m, b) } - -func (x *SeekRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *SeekRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeekRequest.Marshal(b, m, deterministic) } - -func (*SeekRequest) ProtoMessage() {} - -func (x *SeekRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_kv_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *SeekRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeekRequest.Merge(m, src) } - -// Deprecated: Use SeekRequest.ProtoReflect.Descriptor instead. -func (*SeekRequest) Descriptor() ([]byte, []int) { - return file_remote_kv_proto_rawDescGZIP(), []int{0} +func (m *SeekRequest) XXX_Size() int { + return xxx_messageInfo_SeekRequest.Size(m) +} +func (m *SeekRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SeekRequest.DiscardUnknown(m) } -func (x *SeekRequest) GetBucketName() string { - if x != nil { - return x.BucketName +var xxx_messageInfo_SeekRequest proto.InternalMessageInfo + +func (m *SeekRequest) GetBucketName() string { + if m != nil { + return m.BucketName } return "" } -func (x *SeekRequest) GetSeekKey() []byte { - if x != nil { - return x.SeekKey +func (m *SeekRequest) GetSeekKey() []byte { + if m != nil { + return m.SeekKey } return nil } -func (x *SeekRequest) GetPrefix() []byte { - if x != nil { - return x.Prefix +func (m *SeekRequest) GetPrefix() []byte { + if m != nil { + return m.Prefix } return nil } -func (x *SeekRequest) GetStartSreaming() bool { - if x != nil { - return x.StartSreaming +func (m *SeekRequest) GetStartSreaming() bool { + if m != nil { + return m.StartSreaming } return false } type Pair struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Pair) Reset() { - *x = Pair{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_kv_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *Pair) Reset() { *m = Pair{} } +func (m *Pair) String() string { return proto.CompactTextString(m) } +func (*Pair) ProtoMessage() {} +func (*Pair) Descriptor() ([]byte, []int) { + return fileDescriptor_007925a9984cab2c, []int{1} } -func (x *Pair) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *Pair) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Pair.Unmarshal(m, b) } - -func (*Pair) ProtoMessage() {} - -func (x *Pair) ProtoReflect() protoreflect.Message { - mi := &file_remote_kv_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Pair.Marshal(b, m, deterministic) } - -// Deprecated: Use Pair.ProtoReflect.Descriptor instead. -func (*Pair) Descriptor() ([]byte, []int) { - return file_remote_kv_proto_rawDescGZIP(), []int{1} +func (m *Pair) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pair.Merge(m, src) +} +func (m *Pair) XXX_Size() int { + return xxx_messageInfo_Pair.Size(m) } +func (m *Pair) XXX_DiscardUnknown() { + xxx_messageInfo_Pair.DiscardUnknown(m) +} + +var xxx_messageInfo_Pair proto.InternalMessageInfo -func (x *Pair) GetKey() []byte { - if x != nil { - return x.Key +func (m *Pair) GetKey() []byte { + if m != nil { + return m.Key } return nil } -func (x *Pair) GetValue() []byte { - if x != nil { - return x.Value +func (m *Pair) GetValue() []byte { + if m != nil { + return m.Value } return nil } type PairKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - VSize uint64 `protobuf:"varint,2,opt,name=vSize,proto3" json:"vSize,omitempty"` + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + VSize uint64 `protobuf:"varint,2,opt,name=vSize,proto3" json:"vSize,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *PairKey) Reset() { - *x = PairKey{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_kv_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *PairKey) Reset() { *m = PairKey{} } +func (m *PairKey) String() string { return proto.CompactTextString(m) } +func (*PairKey) ProtoMessage() {} +func (*PairKey) Descriptor() ([]byte, []int) { + return fileDescriptor_007925a9984cab2c, []int{2} } -func (x *PairKey) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *PairKey) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PairKey.Unmarshal(m, b) } - -func (*PairKey) ProtoMessage() {} - -func (x *PairKey) ProtoReflect() protoreflect.Message { - mi := &file_remote_kv_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *PairKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PairKey.Marshal(b, m, deterministic) } - -// Deprecated: Use PairKey.ProtoReflect.Descriptor instead. -func (*PairKey) Descriptor() ([]byte, []int) { - return file_remote_kv_proto_rawDescGZIP(), []int{2} +func (m *PairKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PairKey.Merge(m, src) +} +func (m *PairKey) XXX_Size() int { + return xxx_messageInfo_PairKey.Size(m) } +func (m *PairKey) XXX_DiscardUnknown() { + xxx_messageInfo_PairKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PairKey proto.InternalMessageInfo -func (x *PairKey) GetKey() []byte { - if x != nil { - return x.Key +func (m *PairKey) GetKey() []byte { + if m != nil { + return m.Key } return nil } -func (x *PairKey) GetVSize() uint64 { - if x != nil { - return x.VSize +func (m *PairKey) GetVSize() uint64 { + if m != nil { + return m.VSize } return 0 } -var File_remote_kv_proto protoreflect.FileDescriptor - -var file_remote_kv_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x6b, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x0b, 0x53, 0x65, - 0x65, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x65, - 0x6b, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x65, 0x65, 0x6b, - 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x53, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, - 0x67, 0x22, 0x2e, 0x0a, 0x04, 0x50, 0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x31, 0x0a, 0x07, 0x50, 0x61, 0x69, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, - 0x53, 0x69, 0x7a, 0x65, 0x32, 0x33, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x2d, 0x0a, 0x04, 0x53, 0x65, - 0x65, 0x6b, 0x12, 0x13, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x65, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x2e, 0x50, 0x61, 0x69, 0x72, 0x28, 0x01, 0x30, 0x01, 0x42, 0x29, 0x0a, 0x10, 0x69, 0x6f, 0x2e, - 0x74, 0x75, 0x72, 0x62, 0x6f, 0x2d, 0x67, 0x65, 0x74, 0x68, 0x2e, 0x64, 0x62, 0x42, 0x02, 0x4b, - 0x56, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_remote_kv_proto_rawDescOnce sync.Once - file_remote_kv_proto_rawDescData = file_remote_kv_proto_rawDesc -) - -func file_remote_kv_proto_rawDescGZIP() []byte { - file_remote_kv_proto_rawDescOnce.Do(func() { - file_remote_kv_proto_rawDescData = protoimpl.X.CompressGZIP(file_remote_kv_proto_rawDescData) - }) - return file_remote_kv_proto_rawDescData -} - -var file_remote_kv_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_remote_kv_proto_goTypes = []interface{}{ - (*SeekRequest)(nil), // 0: remote.SeekRequest - (*Pair)(nil), // 1: remote.Pair - (*PairKey)(nil), // 2: remote.PairKey -} -var file_remote_kv_proto_depIdxs = []int32{ - 0, // 0: remote.KV.Seek:input_type -> remote.SeekRequest - 1, // 1: remote.KV.Seek:output_type -> remote.Pair - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_remote_kv_proto_init() } -func file_remote_kv_proto_init() { - if File_remote_kv_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_remote_kv_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SeekRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_kv_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pair); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_kv_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PairKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_remote_kv_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_remote_kv_proto_goTypes, - DependencyIndexes: file_remote_kv_proto_depIdxs, - MessageInfos: file_remote_kv_proto_msgTypes, - }.Build() - File_remote_kv_proto = out.File - file_remote_kv_proto_rawDesc = nil - file_remote_kv_proto_goTypes = nil - file_remote_kv_proto_depIdxs = nil +func init() { + proto.RegisterType((*SeekRequest)(nil), "remote.SeekRequest") + proto.RegisterType((*Pair)(nil), "remote.Pair") + proto.RegisterType((*PairKey)(nil), "remote.PairKey") +} + +func init() { proto.RegisterFile("remote/kv.proto", fileDescriptor_007925a9984cab2c) } + +var fileDescriptor_007925a9984cab2c = []byte{ + // 264 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4b, 0xfb, 0x30, + 0x14, 0xc7, 0x49, 0xd7, 0x5f, 0xf7, 0xf3, 0x59, 0xd9, 0x88, 0x22, 0xc1, 0x83, 0x94, 0xe2, 0xa1, + 0x1e, 0x96, 0xa9, 0x3b, 0x7a, 0xdb, 0xb5, 0x20, 0x23, 0x85, 0x1d, 0xbc, 0xa5, 0xfa, 0x9c, 0x21, + 0xd6, 0xcc, 0x34, 0x1d, 0xce, 0xbb, 0xff, 0xb7, 0xa4, 0xd9, 0x60, 0x82, 0xa7, 0xe4, 0xf3, 0xc9, + 0x7b, 0xf9, 0xf2, 0x1e, 0x8c, 0x2c, 0x36, 0xc6, 0xe1, 0x54, 0x6f, 0xf8, 0xda, 0x1a, 0x67, 0x68, + 0x12, 0x44, 0xfe, 0x4d, 0xe0, 0xb8, 0x42, 0xd4, 0x02, 0x3f, 0x3a, 0x6c, 0x1d, 0xbd, 0x04, 0xa8, + 0xbb, 0x27, 0x8d, 0xee, 0x41, 0x36, 0xc8, 0x48, 0x46, 0x8a, 0x23, 0x71, 0x60, 0x28, 0x83, 0x61, + 0x8b, 0xa8, 0x4b, 0xdc, 0xb2, 0x28, 0x23, 0x45, 0x2a, 0xf6, 0x48, 0xcf, 0x21, 0x59, 0x5b, 0x7c, + 0x51, 0x9f, 0x6c, 0xd0, 0x3f, 0xec, 0x88, 0x5e, 0xc1, 0x49, 0xeb, 0xa4, 0x75, 0x95, 0x45, 0xd9, + 0xa8, 0xf7, 0x15, 0x8b, 0x33, 0x52, 0xfc, 0x17, 0xbf, 0x65, 0xce, 0x21, 0x5e, 0x48, 0x65, 0xe9, + 0x18, 0x06, 0x1a, 0xb7, 0x7d, 0x70, 0x2a, 0xfc, 0x95, 0x9e, 0xc1, 0xbf, 0x8d, 0x7c, 0xeb, 0x70, + 0x97, 0x17, 0x20, 0xbf, 0x85, 0xa1, 0xaf, 0xf7, 0xc1, 0x7f, 0xb7, 0x54, 0xea, 0x2b, 0xb4, 0xc4, + 0x22, 0xc0, 0xdd, 0x0c, 0xa2, 0x72, 0x49, 0x27, 0x10, 0xfb, 0x79, 0xe9, 0x29, 0x0f, 0x1b, 0xe0, + 0x07, 0xd3, 0x5f, 0xa4, 0x7b, 0xe9, 0xff, 0x2e, 0xc8, 0x0d, 0x99, 0x5f, 0xc3, 0x58, 0x19, 0xee, + 0x3a, 0x5b, 0x9b, 0xc9, 0x0a, 0xdd, 0x2b, 0x7f, 0xae, 0xe7, 0x51, 0xb9, 0x5c, 0x90, 0xc7, 0x11, + 0x9f, 0x86, 0xe2, 0xfb, 0x70, 0xd4, 0x49, 0xbf, 0xd9, 0xd9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xda, 0x4b, 0xb4, 0x66, 0x6c, 0x01, 0x00, 0x00, } diff --git a/ethdb/remote/kv_grpc.pb.go b/ethdb/remote/kv_grpc.pb.go index 0dcdfe24f50..354e001ab2d 100644 --- a/ethdb/remote/kv_grpc.pb.go +++ b/ethdb/remote/kv_grpc.pb.go @@ -11,7 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion7 // KVClient is the client API for KV service. // @@ -32,8 +32,14 @@ func NewKVClient(cc grpc.ClientConnInterface) KVClient { return &kVClient{cc} } +var kVSeekStreamDesc = &grpc.StreamDesc{ + StreamName: "Seek", + ServerStreams: true, + ClientStreams: true, +} + func (c *kVClient) Seek(ctx context.Context, opts ...grpc.CallOption) (KV_SeekClient, error) { - stream, err := c.cc.NewStream(ctx, &_KV_serviceDesc.Streams[0], "/remote.KV/Seek", opts...) + stream, err := c.cc.NewStream(ctx, kVSeekStreamDesc, "/remote.KV/Seek", opts...) if err != nil { return nil, err } @@ -63,33 +69,20 @@ func (x *kVSeekClient) Recv() (*Pair, error) { return m, nil } -// KVServer is the server API for KV service. -// All implementations must embed UnimplementedKVServer -// for forward compatibility -type KVServer interface { +// KVService is the service API for KV service. +// Fields should be assigned to their respective handler implementations only before +// RegisterKVService is called. Any unassigned fields will result in the +// handler for that method returning an Unimplemented error. +type KVService struct { // open a cursor on given position of given bucket // if streaming requested - streams all data: stops if client's buffer is full, resumes when client read enough from buffer // if streaming not requested - streams next data only when clients sends message to bi-directional channel // no full consistency guarantee - server implementation can close/open underlying db transaction at any time - Seek(KV_SeekServer) error - mustEmbedUnimplementedKVServer() + Seek func(KV_SeekServer) error } -// UnimplementedKVServer must be embedded to have forward compatible implementations. -type UnimplementedKVServer struct { -} - -func (*UnimplementedKVServer) Seek(KV_SeekServer) error { - return status.Errorf(codes.Unimplemented, "method Seek not implemented") -} -func (*UnimplementedKVServer) mustEmbedUnimplementedKVServer() {} - -func RegisterKVServer(s *grpc.Server, srv KVServer) { - s.RegisterService(&_KV_serviceDesc, srv) -} - -func _KV_Seek_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVServer).Seek(&kVSeekServer{stream}) +func (s *KVService) seek(_ interface{}, stream grpc.ServerStream) error { + return s.Seek(&kVSeekServer{stream}) } type KV_SeekServer interface { @@ -114,17 +107,53 @@ func (x *kVSeekServer) Recv() (*SeekRequest, error) { return m, nil } -var _KV_serviceDesc = grpc.ServiceDesc{ - ServiceName: "remote.KV", - HandlerType: (*KVServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Seek", - Handler: _KV_Seek_Handler, - ServerStreams: true, - ClientStreams: true, +// RegisterKVService registers a service implementation with a gRPC server. +func RegisterKVService(s grpc.ServiceRegistrar, srv *KVService) { + srvCopy := *srv + if srvCopy.Seek == nil { + srvCopy.Seek = func(KV_SeekServer) error { + return status.Errorf(codes.Unimplemented, "method Seek not implemented") + } + } + sd := grpc.ServiceDesc{ + ServiceName: "remote.KV", + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Seek", + Handler: srvCopy.seek, + ServerStreams: true, + ClientStreams: true, + }, }, - }, - Metadata: "remote/kv.proto", + Metadata: "remote/kv.proto", + } + + s.RegisterService(&sd, nil) +} + +// NewKVService creates a new KVService containing the +// implemented methods of the KV service in s. Any unimplemented +// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. +// This includes situations where the method handler is misspelled or has the wrong +// signature. For this reason, this function should be used with great care and +// is not recommended to be used by most users. +func NewKVService(s interface{}) *KVService { + ns := &KVService{} + if h, ok := s.(interface{ Seek(KV_SeekServer) error }); ok { + ns.Seek = h.Seek + } + return ns +} + +// UnstableKVService is the service API for KV service. +// New methods may be added to this interface if they are added to the service +// definition, which is not a backward-compatible change. For this reason, +// use of this type is not recommended. +type UnstableKVService interface { + // open a cursor on given position of given bucket + // if streaming requested - streams all data: stops if client's buffer is full, resumes when client read enough from buffer + // if streaming not requested - streams next data only when clients sends message to bi-directional channel + // no full consistency guarantee - server implementation can close/open underlying db transaction at any time + Seek(KV_SeekServer) error } diff --git a/ethdb/remote/remotedbserver/db.go b/ethdb/remote/remotedbserver/db.go index 0a54c074993..8c2417b71fa 100644 --- a/ethdb/remote/remotedbserver/db.go +++ b/ethdb/remote/remotedbserver/db.go @@ -8,7 +8,7 @@ import ( ) type DBServer struct { - remote.UnimplementedDBServer // must be embedded to have forward compatible implementations. + remote.UnstableDBService // must be embedded to have forward compatible implementations. kv ethdb.KV } diff --git a/ethdb/remote/remotedbserver/ethbackend.go b/ethdb/remote/remotedbserver/ethbackend.go index 9eb0e391de1..93ecc868389 100644 --- a/ethdb/remote/remotedbserver/ethbackend.go +++ b/ethdb/remote/remotedbserver/ethbackend.go @@ -12,7 +12,7 @@ import ( ) type EthBackendServer struct { - remote.UnimplementedETHBACKENDServer // must be embedded to have forward compatible implementations. + remote.UnstableETHBACKENDService // must be embedded to have forward compatible implementations. eth core.Backend } diff --git a/ethdb/remote/remotedbserver/server.go b/ethdb/remote/remotedbserver/server.go index c7ab0f4f828..8e74cd487d7 100644 --- a/ethdb/remote/remotedbserver/server.go +++ b/ethdb/remote/remotedbserver/server.go @@ -22,7 +22,7 @@ import ( const MaxTxTTL = time.Minute type KvServer struct { - remote.UnimplementedKVServer // must be embedded to have forward compatible implementations. + remote.UnstableKVService // must be embedded to have forward compatible implementations. kv ethdb.KV } @@ -35,9 +35,24 @@ func StartGrpc(kv ethdb.KV, eth core.Backend, addr string) { return } - kvSrv := NewKvServer(kv) - dbSrv := NewDBServer(kv) - ethBackendSrv := NewEthBackendServer(eth) + kvServer := NewKvServer(kv) + kvSrv := &remote.KVService{ + Seek: kvServer.Seek, + } + + dbServer := NewDBServer(kv) + dbSrv := &remote.DBService{ + Size: dbServer.Size, + BucketSize: dbServer.BucketSize, + } + + ethServer := NewEthBackendServer(eth) + ethBackendSrv := &remote.ETHBACKENDService{ + Add: ethServer.Add, + Etherbase: ethServer.Etherbase, + NetVersion: ethServer.NetVersion, + BloomStatus: ethServer.BloomStatus, + } var ( streamInterceptors []grpc.StreamServerInterceptor unaryInterceptors []grpc.UnaryServerInterceptor @@ -57,9 +72,9 @@ func StartGrpc(kv ethdb.KV, eth core.Backend, addr string) { grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(streamInterceptors...)), grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unaryInterceptors...)), ) - remote.RegisterKVServer(grpcServer, kvSrv) - remote.RegisterDBServer(grpcServer, dbSrv) - remote.RegisterETHBACKENDServer(grpcServer, ethBackendSrv) + remote.RegisterKVService(grpcServer, kvSrv) + remote.RegisterDBService(grpcServer, dbSrv) + remote.RegisterETHBACKENDService(grpcServer, ethBackendSrv) if metrics.Enabled { grpc_prometheus.Register(grpcServer) diff --git a/go.mod b/go.mod index fa5c3c664bc..3a502bd3c26 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 - google.golang.org/grpc v1.30.1 + google.golang.org/grpc v1.33.0-dev google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe // indirect google.golang.org/protobuf v1.25.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 diff --git a/go.sum b/go.sum index 313fbceee40..1a67be6e11d 100644 --- a/go.sum +++ b/go.sum @@ -391,6 +391,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= @@ -419,9 +421,13 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -444,6 +450,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2El google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200901141002-b3bf27a9dbd1 h1:MGeK4uU2ZEzqyM8OY86kentcshTg5D7a4D3l4xhNns4= +google.golang.org/genproto v0.0.0-20200901141002-b3bf27a9dbd1/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -452,6 +460,9 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.30.1 h1:oJTcovwKSu7V3TaBKd0/AXOuJVHjTdGTutbMHIOgVEQ= google.golang.org/grpc v1.30.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.0-dev h1:c0EY3sGPLj50wEdGQDpiS3zvk/zdduzrAkJTfa9ocjY= +google.golang.org/grpc v1.33.0-dev/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe h1:Wd/jb/cOPNfvxxUAejtru6/krTJyzX6aGV5GY7EcqI0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -463,6 +474,7 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= From 07d9d2f9807141278c368b67d87c5f8904f33532 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 15:10:06 +0300 Subject: [PATCH 05/21] go mod tidy --- go.mod | 5 +---- go.sum | 34 ---------------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/go.mod b/go.mod index 3a502bd3c26..0bbad498f98 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,6 @@ require ( github.com/emicklei/dot v0.11.0 github.com/ethereum/evmc/v7 v7.3.0 github.com/fatih/color v1.7.0 - github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff github.com/gin-gonic/gin v1.6.2 github.com/go-ole/go-ole v1.2.4 // indirect @@ -44,7 +43,6 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 github.com/julienschmidt/httprouter v1.2.0 github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 - github.com/kevinburke/go-bindata v3.21.0+incompatible // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 github.com/ledgerwatch/lmdb-go v1.13.1-0.20200829020305-221d50cfedab @@ -78,8 +76,7 @@ require ( golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 google.golang.org/grpc v1.33.0-dev - google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe // indirect - google.golang.org/protobuf v1.25.0 + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 diff --git a/go.sum b/go.sum index 1a67be6e11d..2ff2cd991e1 100644 --- a/go.sum +++ b/go.sum @@ -98,12 +98,8 @@ github.com/ethereum/evmc/v7 v7.3.0 h1:4CsjJ+vSRrkzxOHeG1lFRGk4sG4/PgzXnWuRNgLGMJ github.com/ethereum/evmc/v7 v7.3.0/go.mod h1:q2Q0rCSUlIkngd+mZwfCzEUbvB0IIopH1+7hcs9QuDg= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f h1:Y/gg/utVetS+WS6htAKCTDralkm/8hLIIUAtLFdbdQ8= -github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f/go.mod h1:q+7Z5oyy8cvKF3TakcuihvQvBHFTnXjB+7UP1e2Q+1o= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -186,7 +182,6 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -209,8 +204,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= -github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -221,7 +214,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 h1:8e99Kuxoi+RnWCO8zD+ftp+rIuh9AYkZDRPmO8Xgp5k= @@ -268,9 +260,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= @@ -378,7 +367,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -387,12 +375,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= @@ -407,7 +392,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -421,13 +405,9 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -438,9 +418,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9 h1:m9xhlkk2j+sO9WjAgNfTtl505MN7ZkuW69nOcBlp9qY= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -450,21 +427,13 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2El google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200901141002-b3bf27a9dbd1 h1:MGeK4uU2ZEzqyM8OY86kentcshTg5D7a4D3l4xhNns4= -google.golang.org/genproto v0.0.0-20200901141002-b3bf27a9dbd1/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.30.1 h1:oJTcovwKSu7V3TaBKd0/AXOuJVHjTdGTutbMHIOgVEQ= -google.golang.org/grpc v1.30.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.0-dev h1:c0EY3sGPLj50wEdGQDpiS3zvk/zdduzrAkJTfa9ocjY= google.golang.org/grpc v1.33.0-dev/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe h1:Wd/jb/cOPNfvxxUAejtru6/krTJyzX6aGV5GY7EcqI0= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -474,7 +443,6 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -482,13 +450,11 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 6e4f7247e9dad1fbecd659e0fb94317dc7fc0d7e Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 19:52:25 +0300 Subject: [PATCH 06/21] unmarshall adresses or adress --- cmd/rpcdaemon/commands/eth_api.go | 5 ++-- cmd/rpcdaemon/commands/get_receipts.go | 10 +++++-- eth/filters/api.go | 5 ++-- eth/filters/filter.go | 7 ++--- eth/filters/filter_system_test.go | 41 +++++++++++++------------- ethclient/ethclient.go | 16 ++++++++-- ethclient/ethclient_test.go | 17 ++++++----- interfaces.go | 5 ++-- rpc/types.go | 5 ++++ 9 files changed, 66 insertions(+), 45 deletions(-) diff --git a/cmd/rpcdaemon/commands/eth_api.go b/cmd/rpcdaemon/commands/eth_api.go index 23ed49968fa..dbbbe26487c 100644 --- a/cmd/rpcdaemon/commands/eth_api.go +++ b/cmd/rpcdaemon/commands/eth_api.go @@ -3,7 +3,8 @@ package commands import ( "context" "fmt" - ethereum "github.com/ledgerwatch/turbo-geth" + + "github.com/ledgerwatch/turbo-geth/eth/filters" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" @@ -24,7 +25,7 @@ type EthAPI interface { GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) - GetLogs(ctx context.Context, crit ethereum.FilterQuery) ([]*types.Log, error) + GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error) Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *map[common.Address]ethapi.Account) (hexutil.Bytes, error) EstimateGas(ctx context.Context, args ethapi.CallArgs) (hexutil.Uint64, error) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error) diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 1c67ca16b0a..7222a96e168 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -6,7 +6,6 @@ import ( "fmt" "math/big" - ethereum "github.com/ledgerwatch/turbo-geth" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" "github.com/ledgerwatch/turbo-geth/core" @@ -14,6 +13,7 @@ import ( "github.com/ledgerwatch/turbo-geth/core/rawdb" "github.com/ledgerwatch/turbo-geth/core/types" "github.com/ledgerwatch/turbo-geth/core/vm" + "github.com/ledgerwatch/turbo-geth/eth/filters" "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/params" "github.com/ledgerwatch/turbo-geth/rpc" @@ -105,7 +105,7 @@ func newFilter(addresses []common.Address, topics [][]common.Hash) *Filter { } // GetLogs returns logs matching the given argument that are stored within the state. -func (api *APIImpl) GetLogs(ctx context.Context, crit ethereum.FilterQuery) ([]*types.Log, error) { +func (api *APIImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error) { var filter *Filter if crit.BlockHash != nil { // Block filter requested, construct a single-shot filter @@ -125,7 +125,11 @@ func (api *APIImpl) GetLogs(ctx context.Context, crit ethereum.FilterQuery) ([]* if crit.ToBlock != nil { end = crit.ToBlock.Int64() } - // Construct the range filter + + if begin > end { + return nil, fmt.Errorf("start block height (%d) must be less than end block height (%d)", begin, end) + } + filter = NewRangeFilter(begin, end, crit.Addresses, crit.Topics) } // Run the filter and return all the logs diff --git a/eth/filters/api.go b/eth/filters/api.go index 39d16ef8989..5af736d5587 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -21,7 +21,6 @@ import ( "encoding/json" "errors" "fmt" - "math/big" "sync" "time" @@ -502,11 +501,11 @@ func (args *FilterCriteria) UnmarshalJSON(data []byte) error { args.BlockHash = raw.BlockHash } else { if raw.FromBlock != nil { - args.FromBlock = big.NewInt(raw.FromBlock.Int64()) + args.FromBlock = rpc.NewRPCBlockNumber(int(raw.FromBlock.Int64())) } if raw.ToBlock != nil { - args.ToBlock = big.NewInt(raw.ToBlock.Int64()) + args.ToBlock = rpc.NewRPCBlockNumber(int(raw.ToBlock.Int64())) } } diff --git a/eth/filters/filter.go b/eth/filters/filter.go index ce88db7765c..c8de09ae644 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -19,7 +19,6 @@ package filters import ( "context" "errors" - "math/big" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/core" @@ -283,14 +282,14 @@ func includes(addresses []common.Address, a common.Address) bool { } // filterLogs creates a slice of logs matching the given criteria. -func filterLogs(logs []*types.Log, fromBlock, toBlock *big.Int, addresses []common.Address, topics [][]common.Hash) []*types.Log { +func filterLogs(logs []*types.Log, fromBlock, toBlock *rpc.BlockNumber, addresses []common.Address, topics [][]common.Hash) []*types.Log { var ret []*types.Log Logs: for _, log := range logs { - if fromBlock != nil && fromBlock.Int64() >= 0 && fromBlock.Uint64() > log.BlockNumber { + if fromBlock != nil && fromBlock.Int64() >= 0 && uint64(fromBlock.Int64()) > log.BlockNumber { continue } - if toBlock != nil && toBlock.Int64() >= 0 && toBlock.Uint64() < log.BlockNumber { + if toBlock != nil && toBlock.Int64() >= 0 && uint64(toBlock.Int64()) < log.BlockNumber { continue } diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index c74a58ae550..409a5919503 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -19,7 +19,6 @@ package filters import ( "context" "fmt" - "math/big" "math/rand" "reflect" "testing" @@ -284,19 +283,19 @@ func TestLogFilterCreation(t *testing.T) { // defaults {FilterCriteria{}, true}, // valid block number range - {FilterCriteria{FromBlock: big.NewInt(1), ToBlock: big.NewInt(2)}, true}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(1), ToBlock: rpc.NewRPCBlockNumber(2)}, true}, // "mined" block range to pending - {FilterCriteria{FromBlock: big.NewInt(1), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, true}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(1), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, true}, // new mined and pending blocks - {FilterCriteria{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, true}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64()))}, true}, // from block "higher" than to block - {FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(1)}, false}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(1)}, false}, // from block "higher" than to block - {FilterCriteria{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(100)}, false}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, false}, // from block "higher" than to block - {FilterCriteria{FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(100)}, false}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, false}, // from block "higher" than to block - {FilterCriteria{FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, false}, + {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, false}, } ) @@ -325,9 +324,9 @@ func TestInvalidLogFilterCreation(t *testing.T) { // different situations where log filter creation should fail. // Reason: fromBlock > toBlock testCases := []FilterCriteria{ - 0: {FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, - 1: {FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(100)}, - 2: {FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(100)}, + 0: {FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, + 1: {FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, + 2: {FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, } for i, test := range testCases { @@ -348,9 +347,9 @@ func TestInvalidGetLogsRequest(t *testing.T) { // Reason: Cannot specify both BlockHash and FromBlock/ToBlock) testCases := []FilterCriteria{ - 0: {BlockHash: &blockHash, FromBlock: big.NewInt(100)}, - 1: {BlockHash: &blockHash, ToBlock: big.NewInt(500)}, - 2: {BlockHash: &blockHash, FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, + 0: {BlockHash: &blockHash, FromBlock: rpc.NewRPCBlockNumber(100)}, + 1: {BlockHash: &blockHash, ToBlock: rpc.NewRPCBlockNumber(500)}, + 2: {BlockHash: &blockHash, FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, } for i, test := range testCases { @@ -408,17 +407,17 @@ func TestLogFilter(t *testing.T) { // match logs based on multiple addresses and "or" topics 5: {FilterCriteria{Addresses: []common.Address{secondAddr, thirdAddress}, Topics: [][]common.Hash{{firstTopic, secondTopic}}}, allLogs[2:5], ""}, // logs in the pending block - 6: {FilterCriteria{Addresses: []common.Address{firstAddr}, FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, allLogs[:2], ""}, + 6: {FilterCriteria{Addresses: []common.Address{firstAddr}, FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64()))}, allLogs[:2], ""}, // mined logs with block num >= 2 or pending logs - 7: {FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, expectedCase7, ""}, + 7: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64()))}, expectedCase7, ""}, // all "mined" logs with block num >= 2 - 8: {FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, allLogs[3:], ""}, + 8: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, allLogs[3:], ""}, // all "mined" logs - 9: {FilterCriteria{ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, allLogs, ""}, + 9: {FilterCriteria{ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, allLogs, ""}, // all "mined" logs with 1>= block num <=2 and topic secondTopic - 10: {FilterCriteria{FromBlock: big.NewInt(1), ToBlock: big.NewInt(2), Topics: [][]common.Hash{{secondTopic}}}, allLogs[3:4], ""}, + 10: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(1), ToBlock: rpc.NewRPCBlockNumber(2), Topics: [][]common.Hash{{secondTopic}}}, allLogs[3:4], ""}, // all "mined" and pending logs with topic firstTopic - 11: {FilterCriteria{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), Topics: [][]common.Hash{{firstTopic}}}, expectedCase11, ""}, + 11: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), Topics: [][]common.Hash{{firstTopic}}}, expectedCase11, ""}, // match all logs due to wildcard topic 12: {FilterCriteria{Topics: [][]common.Hash{nil}}, allLogs[1:], ""}, } @@ -552,7 +551,7 @@ func TestPendingLogsSubscription(t *testing.T) { }, // block numbers are ignored for filters created with New***Filter, these return all logs that match the given criteria when the state changes { - ethereum.FilterQuery{Addresses: []common.Address{firstAddr}, FromBlock: big.NewInt(2), ToBlock: big.NewInt(3)}, + ethereum.FilterQuery{Addresses: []common.Address{firstAddr}, FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(3)}, append(flattenLogs(allLogs[:2]), allLogs[5][3]), nil, nil, }, diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index b903146830c..fbd28f30e28 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -292,6 +292,18 @@ func toBlockNumArg(number *big.Int) string { return hexutil.EncodeBig(number) } + +func toBlockNum(number *rpc.BlockNumber) string { + if number == nil { + return "latest" + } + pending := big.NewInt(-1) + if number.Int64() == pending.Int64() { + return "pending" + } + return hexutil.EncodeUint64(uint64(number.Int64())) +} + type rpcProgress struct { StartingBlock hexutil.Uint64 CurrentBlock hexutil.Uint64 @@ -414,9 +426,9 @@ func toFilterArg(q ethereum.FilterQuery) (interface{}, error) { if q.FromBlock == nil { arg["fromBlock"] = "0x0" } else { - arg["fromBlock"] = toBlockNumArg(q.FromBlock) + arg["fromBlock"] = toBlockNum(q.FromBlock) } - arg["toBlock"] = toBlockNumArg(q.ToBlock) + arg["toBlock"] = toBlockNum(q.ToBlock) } return arg, nil } diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index c40fa77fb4c..a04969af7e0 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -35,6 +35,7 @@ import ( "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/node" "github.com/ledgerwatch/turbo-geth/params" + "github.com/ledgerwatch/turbo-geth/rpc" ) // Verify that Client implements the ethereum interfaces. @@ -71,8 +72,8 @@ func TestToFilterArg(t *testing.T) { "without BlockHash", ethereum.FilterQuery{ Addresses: addresses, - FromBlock: big.NewInt(1), - ToBlock: big.NewInt(2), + FromBlock: rpc.NewRPCBlockNumber(1), + ToBlock: rpc.NewRPCBlockNumber(2), Topics: [][]common.Hash{}, }, map[string]interface{}{ @@ -101,8 +102,8 @@ func TestToFilterArg(t *testing.T) { "with negative fromBlock and negative toBlock", ethereum.FilterQuery{ Addresses: addresses, - FromBlock: big.NewInt(-1), - ToBlock: big.NewInt(-1), + FromBlock: rpc.NewRPCBlockNumber(-1), + ToBlock: rpc.NewRPCBlockNumber(-1), Topics: [][]common.Hash{}, }, map[string]interface{}{ @@ -132,7 +133,7 @@ func TestToFilterArg(t *testing.T) { ethereum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, - FromBlock: big.NewInt(1), + FromBlock: rpc.NewRPCBlockNumber(1), Topics: [][]common.Hash{}, }, nil, @@ -143,7 +144,7 @@ func TestToFilterArg(t *testing.T) { ethereum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, - ToBlock: big.NewInt(1), + ToBlock: rpc.NewRPCBlockNumber(1), Topics: [][]common.Hash{}, }, nil, @@ -154,8 +155,8 @@ func TestToFilterArg(t *testing.T) { ethereum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, - FromBlock: big.NewInt(1), - ToBlock: big.NewInt(2), + FromBlock: rpc.NewRPCBlockNumber(1), + ToBlock: rpc.NewRPCBlockNumber(2), Topics: [][]common.Hash{}, }, nil, diff --git a/interfaces.go b/interfaces.go index e81cab834b1..47df1121adb 100644 --- a/interfaces.go +++ b/interfaces.go @@ -26,6 +26,7 @@ import ( "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/core/types" + "github.com/ledgerwatch/turbo-geth/rpc" ) // NotFound is returned by API methods if the requested item does not exist. @@ -134,8 +135,8 @@ type ContractCaller interface { // FilterQuery contains options for contract log filtering. type FilterQuery struct { BlockHash *common.Hash // used by eth_getLogs, return logs only from block with this hash - FromBlock *big.Int // beginning of the queried range, nil means genesis block - ToBlock *big.Int // end of the range, nil means latest block + FromBlock *rpc.BlockNumber // beginning of the queried range, nil means genesis block + ToBlock *rpc.BlockNumber // end of the range, nil means latest block Addresses []common.Address // restricts matches to events created by specific contracts // The Topic list restricts matches to particular event topics. Each event has a list diff --git a/rpc/types.go b/rpc/types.go index 413febbd68a..dc80d1f952b 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -69,6 +69,11 @@ type jsonWriter interface { type BlockNumber int64 +func NewRPCBlockNumber(n int) *BlockNumber { + num := BlockNumber(n) + return &num +} + const ( PendingBlockNumber = BlockNumber(-2) LatestBlockNumber = BlockNumber(-1) From 03e40910cda3b6c6a96b4a9dc844b58acabd112f Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 20:00:41 +0300 Subject: [PATCH 07/21] fix linters --- accounts/abi/bind/base.go | 7 ++++--- ethclient/ethclient.go | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 6a77a1fbd77..d21afa7de22 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -30,6 +30,7 @@ import ( "github.com/ledgerwatch/turbo-geth/core/types" "github.com/ledgerwatch/turbo-geth/crypto" "github.com/ledgerwatch/turbo-geth/event" + "github.com/ledgerwatch/turbo-geth/rpc" ) // SignerFn is a signer function callback when a contract requires a method to @@ -279,10 +280,10 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int config := ethereum.FilterQuery{ Addresses: []common.Address{c.address}, Topics: topics, - FromBlock: new(big.Int).SetUint64(opts.Start), + FromBlock: rpc.NewRPCBlockNumber(int(opts.Start)), } if opts.End != nil { - config.ToBlock = new(big.Int).SetUint64(*opts.End) + config.ToBlock = rpc.NewRPCBlockNumber(int(*opts.End)) } /* TODO(karalabe): Replace the rest of the method below with this when supported sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs) @@ -330,7 +331,7 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter Topics: topics, } if opts.Start != nil { - config.FromBlock = new(big.Int).SetUint64(*opts.Start) + config.FromBlock = rpc.NewRPCBlockNumber(int(*opts.Start)) } sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs) if err != nil { diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index fbd28f30e28..d7328491e56 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -292,7 +292,6 @@ func toBlockNumArg(number *big.Int) string { return hexutil.EncodeBig(number) } - func toBlockNum(number *rpc.BlockNumber) string { if number == nil { return "latest" From 98476133bb1f426fa762205eb3871e60fe86d508 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 20:24:10 +0300 Subject: [PATCH 08/21] after cr --- cmd/rpcdaemon/commands/get_chain_config.go | 11 +++++++++++ cmd/rpcdaemon/commands/get_receipts.go | 10 +++------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 cmd/rpcdaemon/commands/get_chain_config.go diff --git a/cmd/rpcdaemon/commands/get_chain_config.go b/cmd/rpcdaemon/commands/get_chain_config.go new file mode 100644 index 00000000000..b861a87d0b8 --- /dev/null +++ b/cmd/rpcdaemon/commands/get_chain_config.go @@ -0,0 +1,11 @@ +package commands + +import ( + "github.com/ledgerwatch/turbo-geth/core/rawdb" + "github.com/ledgerwatch/turbo-geth/params" +) + +func getChainConfig(db rawdb.DatabaseReader) *params.ChainConfig { + genesisHash := rawdb.ReadBlockByNumber(db, 0).Hash() + return rawdb.ReadChainConfig(db, genesisHash) +} diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 7222a96e168..17fa625ac56 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -34,8 +34,7 @@ func GetReceipts(ctx context.Context, db rawdb.DatabaseReader, cfg *params.Chain cc := adapter.NewChainContext(db) bc := adapter.NewBlockGetter(db) - genesisHash := rawdb.ReadBlockByNumber(db, 0).Hash() - chainConfig := rawdb.ReadChainConfig(db, genesisHash) + chainConfig := getChainConfig(db) _, _, ibs, dbstate, err := transactions.ComputeTxEnv(ctx, bc, chainConfig, cc, db.(ethdb.HasKV).KV(), hash, 0) if err != nil { return nil, err @@ -126,10 +125,6 @@ func (api *APIImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([ end = crit.ToBlock.Int64() } - if begin > end { - return nil, fmt.Errorf("start block height (%d) must be less than end block height (%d)", begin, end) - } - filter = NewRangeFilter(begin, end, crit.Addresses, crit.Topics) } // Run the filter and return all the logs @@ -356,7 +351,8 @@ func (f *Filter) checkMatches(ctx context.Context, header *types.Header, api *AP if len(logs) > 0 { // We have matching logs, check if we need to resolve full logs via the light client if logs[0].TxHash == (common.Hash{}) { - receipts := rawdb.ReadReceipts(api.dbReader, header.Hash(), header.Number.Uint64(), params.MainnetChainConfig) + chainConfig := getChainConfig(api.dbReader) + receipts := rawdb.ReadReceipts(api.dbReader, header.Hash(), header.Number.Uint64(), chainConfig) unfiltered = unfiltered[:0] for _, receipt := range receipts { unfiltered = append(unfiltered, receipt.Logs...) From 47cb19a5d25075cd0c07ca876278378155123819 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 20:28:00 +0300 Subject: [PATCH 09/21] after cr --- cmd/rpcdaemon/commands/get_receipts.go | 3 +++ eth/filters/api.go | 5 +++-- eth/filters/filter.go | 3 ++- ethclient/ethclient.go | 15 ++------------- interfaces.go | 5 ++--- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 17fa625ac56..8059a259fd5 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -6,6 +6,8 @@ import ( "fmt" "math/big" + "github.com/davecgh/go-spew/spew" + "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" "github.com/ledgerwatch/turbo-geth/core" @@ -105,6 +107,7 @@ func newFilter(addresses []common.Address, topics [][]common.Hash) *Filter { // GetLogs returns logs matching the given argument that are stored within the state. func (api *APIImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error) { + spew.Dump(crit) var filter *Filter if crit.BlockHash != nil { // Block filter requested, construct a single-shot filter diff --git a/eth/filters/api.go b/eth/filters/api.go index 5af736d5587..39d16ef8989 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -21,6 +21,7 @@ import ( "encoding/json" "errors" "fmt" + "math/big" "sync" "time" @@ -501,11 +502,11 @@ func (args *FilterCriteria) UnmarshalJSON(data []byte) error { args.BlockHash = raw.BlockHash } else { if raw.FromBlock != nil { - args.FromBlock = rpc.NewRPCBlockNumber(int(raw.FromBlock.Int64())) + args.FromBlock = big.NewInt(raw.FromBlock.Int64()) } if raw.ToBlock != nil { - args.ToBlock = rpc.NewRPCBlockNumber(int(raw.ToBlock.Int64())) + args.ToBlock = big.NewInt(raw.ToBlock.Int64()) } } diff --git a/eth/filters/filter.go b/eth/filters/filter.go index c8de09ae644..948f01c246c 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -19,6 +19,7 @@ package filters import ( "context" "errors" + "math/big" "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/core" @@ -282,7 +283,7 @@ func includes(addresses []common.Address, a common.Address) bool { } // filterLogs creates a slice of logs matching the given criteria. -func filterLogs(logs []*types.Log, fromBlock, toBlock *rpc.BlockNumber, addresses []common.Address, topics [][]common.Hash) []*types.Log { +func filterLogs(logs []*types.Log, fromBlock, toBlock *big.Int, addresses []common.Address, topics [][]common.Hash) []*types.Log { var ret []*types.Log Logs: for _, log := range logs { diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index d7328491e56..b903146830c 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -292,17 +292,6 @@ func toBlockNumArg(number *big.Int) string { return hexutil.EncodeBig(number) } -func toBlockNum(number *rpc.BlockNumber) string { - if number == nil { - return "latest" - } - pending := big.NewInt(-1) - if number.Int64() == pending.Int64() { - return "pending" - } - return hexutil.EncodeUint64(uint64(number.Int64())) -} - type rpcProgress struct { StartingBlock hexutil.Uint64 CurrentBlock hexutil.Uint64 @@ -425,9 +414,9 @@ func toFilterArg(q ethereum.FilterQuery) (interface{}, error) { if q.FromBlock == nil { arg["fromBlock"] = "0x0" } else { - arg["fromBlock"] = toBlockNum(q.FromBlock) + arg["fromBlock"] = toBlockNumArg(q.FromBlock) } - arg["toBlock"] = toBlockNum(q.ToBlock) + arg["toBlock"] = toBlockNumArg(q.ToBlock) } return arg, nil } diff --git a/interfaces.go b/interfaces.go index 47df1121adb..e81cab834b1 100644 --- a/interfaces.go +++ b/interfaces.go @@ -26,7 +26,6 @@ import ( "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/core/types" - "github.com/ledgerwatch/turbo-geth/rpc" ) // NotFound is returned by API methods if the requested item does not exist. @@ -135,8 +134,8 @@ type ContractCaller interface { // FilterQuery contains options for contract log filtering. type FilterQuery struct { BlockHash *common.Hash // used by eth_getLogs, return logs only from block with this hash - FromBlock *rpc.BlockNumber // beginning of the queried range, nil means genesis block - ToBlock *rpc.BlockNumber // end of the range, nil means latest block + FromBlock *big.Int // beginning of the queried range, nil means genesis block + ToBlock *big.Int // end of the range, nil means latest block Addresses []common.Address // restricts matches to events created by specific contracts // The Topic list restricts matches to particular event topics. Each event has a list From 657da94e639252ea9b806b62ac773a3b0dac823d Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 20:29:03 +0300 Subject: [PATCH 10/21] after cr --- cmd/rpcdaemon/commands/get_receipts.go | 3 -- eth/filters/filter_system_test.go | 41 +++++++++++++------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/cmd/rpcdaemon/commands/get_receipts.go b/cmd/rpcdaemon/commands/get_receipts.go index 8059a259fd5..17fa625ac56 100644 --- a/cmd/rpcdaemon/commands/get_receipts.go +++ b/cmd/rpcdaemon/commands/get_receipts.go @@ -6,8 +6,6 @@ import ( "fmt" "math/big" - "github.com/davecgh/go-spew/spew" - "github.com/ledgerwatch/turbo-geth/common" "github.com/ledgerwatch/turbo-geth/common/hexutil" "github.com/ledgerwatch/turbo-geth/core" @@ -107,7 +105,6 @@ func newFilter(addresses []common.Address, topics [][]common.Hash) *Filter { // GetLogs returns logs matching the given argument that are stored within the state. func (api *APIImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error) { - spew.Dump(crit) var filter *Filter if crit.BlockHash != nil { // Block filter requested, construct a single-shot filter diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index 409a5919503..c74a58ae550 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -19,6 +19,7 @@ package filters import ( "context" "fmt" + "math/big" "math/rand" "reflect" "testing" @@ -283,19 +284,19 @@ func TestLogFilterCreation(t *testing.T) { // defaults {FilterCriteria{}, true}, // valid block number range - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(1), ToBlock: rpc.NewRPCBlockNumber(2)}, true}, + {FilterCriteria{FromBlock: big.NewInt(1), ToBlock: big.NewInt(2)}, true}, // "mined" block range to pending - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(1), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, true}, + {FilterCriteria{FromBlock: big.NewInt(1), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, true}, // new mined and pending blocks - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64()))}, true}, + {FilterCriteria{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, true}, // from block "higher" than to block - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(1)}, false}, + {FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(1)}, false}, // from block "higher" than to block - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, false}, + {FilterCriteria{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(100)}, false}, // from block "higher" than to block - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, false}, + {FilterCriteria{FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(100)}, false}, // from block "higher" than to block - {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, false}, + {FilterCriteria{FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, false}, } ) @@ -324,9 +325,9 @@ func TestInvalidLogFilterCreation(t *testing.T) { // different situations where log filter creation should fail. // Reason: fromBlock > toBlock testCases := []FilterCriteria{ - 0: {FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, - 1: {FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, - 2: {FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(100)}, + 0: {FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, + 1: {FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(100)}, + 2: {FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(100)}, } for i, test := range testCases { @@ -347,9 +348,9 @@ func TestInvalidGetLogsRequest(t *testing.T) { // Reason: Cannot specify both BlockHash and FromBlock/ToBlock) testCases := []FilterCriteria{ - 0: {BlockHash: &blockHash, FromBlock: rpc.NewRPCBlockNumber(100)}, - 1: {BlockHash: &blockHash, ToBlock: rpc.NewRPCBlockNumber(500)}, - 2: {BlockHash: &blockHash, FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, + 0: {BlockHash: &blockHash, FromBlock: big.NewInt(100)}, + 1: {BlockHash: &blockHash, ToBlock: big.NewInt(500)}, + 2: {BlockHash: &blockHash, FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, } for i, test := range testCases { @@ -407,17 +408,17 @@ func TestLogFilter(t *testing.T) { // match logs based on multiple addresses and "or" topics 5: {FilterCriteria{Addresses: []common.Address{secondAddr, thirdAddress}, Topics: [][]common.Hash{{firstTopic, secondTopic}}}, allLogs[2:5], ""}, // logs in the pending block - 6: {FilterCriteria{Addresses: []common.Address{firstAddr}, FromBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64()))}, allLogs[:2], ""}, + 6: {FilterCriteria{Addresses: []common.Address{firstAddr}, FromBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, allLogs[:2], ""}, // mined logs with block num >= 2 or pending logs - 7: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64()))}, expectedCase7, ""}, + 7: {FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, expectedCase7, ""}, // all "mined" logs with block num >= 2 - 8: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, allLogs[3:], ""}, + 8: {FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, allLogs[3:], ""}, // all "mined" logs - 9: {FilterCriteria{ToBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64()))}, allLogs, ""}, + 9: {FilterCriteria{ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, allLogs, ""}, // all "mined" logs with 1>= block num <=2 and topic secondTopic - 10: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(1), ToBlock: rpc.NewRPCBlockNumber(2), Topics: [][]common.Hash{{secondTopic}}}, allLogs[3:4], ""}, + 10: {FilterCriteria{FromBlock: big.NewInt(1), ToBlock: big.NewInt(2), Topics: [][]common.Hash{{secondTopic}}}, allLogs[3:4], ""}, // all "mined" and pending logs with topic firstTopic - 11: {FilterCriteria{FromBlock: rpc.NewRPCBlockNumber(int(rpc.LatestBlockNumber.Int64())), ToBlock: rpc.NewRPCBlockNumber(int(rpc.PendingBlockNumber.Int64())), Topics: [][]common.Hash{{firstTopic}}}, expectedCase11, ""}, + 11: {FilterCriteria{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64()), Topics: [][]common.Hash{{firstTopic}}}, expectedCase11, ""}, // match all logs due to wildcard topic 12: {FilterCriteria{Topics: [][]common.Hash{nil}}, allLogs[1:], ""}, } @@ -551,7 +552,7 @@ func TestPendingLogsSubscription(t *testing.T) { }, // block numbers are ignored for filters created with New***Filter, these return all logs that match the given criteria when the state changes { - ethereum.FilterQuery{Addresses: []common.Address{firstAddr}, FromBlock: rpc.NewRPCBlockNumber(2), ToBlock: rpc.NewRPCBlockNumber(3)}, + ethereum.FilterQuery{Addresses: []common.Address{firstAddr}, FromBlock: big.NewInt(2), ToBlock: big.NewInt(3)}, append(flattenLogs(allLogs[:2]), allLogs[5][3]), nil, nil, }, From 2013415ae0448690438353af480f76fcfa9d6025 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 20:29:34 +0300 Subject: [PATCH 11/21] after cr --- accounts/abi/bind/base.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index d21afa7de22..6a77a1fbd77 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -30,7 +30,6 @@ import ( "github.com/ledgerwatch/turbo-geth/core/types" "github.com/ledgerwatch/turbo-geth/crypto" "github.com/ledgerwatch/turbo-geth/event" - "github.com/ledgerwatch/turbo-geth/rpc" ) // SignerFn is a signer function callback when a contract requires a method to @@ -280,10 +279,10 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int config := ethereum.FilterQuery{ Addresses: []common.Address{c.address}, Topics: topics, - FromBlock: rpc.NewRPCBlockNumber(int(opts.Start)), + FromBlock: new(big.Int).SetUint64(opts.Start), } if opts.End != nil { - config.ToBlock = rpc.NewRPCBlockNumber(int(*opts.End)) + config.ToBlock = new(big.Int).SetUint64(*opts.End) } /* TODO(karalabe): Replace the rest of the method below with this when supported sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs) @@ -331,7 +330,7 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter Topics: topics, } if opts.Start != nil { - config.FromBlock = rpc.NewRPCBlockNumber(int(*opts.Start)) + config.FromBlock = new(big.Int).SetUint64(*opts.Start) } sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs) if err != nil { From 9d93b55847f09b8f797db814ffd575d1c662f524 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 20:33:36 +0300 Subject: [PATCH 12/21] fix tests --- ethclient/ethclient_test.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index a04969af7e0..c40fa77fb4c 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -35,7 +35,6 @@ import ( "github.com/ledgerwatch/turbo-geth/ethdb" "github.com/ledgerwatch/turbo-geth/node" "github.com/ledgerwatch/turbo-geth/params" - "github.com/ledgerwatch/turbo-geth/rpc" ) // Verify that Client implements the ethereum interfaces. @@ -72,8 +71,8 @@ func TestToFilterArg(t *testing.T) { "without BlockHash", ethereum.FilterQuery{ Addresses: addresses, - FromBlock: rpc.NewRPCBlockNumber(1), - ToBlock: rpc.NewRPCBlockNumber(2), + FromBlock: big.NewInt(1), + ToBlock: big.NewInt(2), Topics: [][]common.Hash{}, }, map[string]interface{}{ @@ -102,8 +101,8 @@ func TestToFilterArg(t *testing.T) { "with negative fromBlock and negative toBlock", ethereum.FilterQuery{ Addresses: addresses, - FromBlock: rpc.NewRPCBlockNumber(-1), - ToBlock: rpc.NewRPCBlockNumber(-1), + FromBlock: big.NewInt(-1), + ToBlock: big.NewInt(-1), Topics: [][]common.Hash{}, }, map[string]interface{}{ @@ -133,7 +132,7 @@ func TestToFilterArg(t *testing.T) { ethereum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, - FromBlock: rpc.NewRPCBlockNumber(1), + FromBlock: big.NewInt(1), Topics: [][]common.Hash{}, }, nil, @@ -144,7 +143,7 @@ func TestToFilterArg(t *testing.T) { ethereum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, - ToBlock: rpc.NewRPCBlockNumber(1), + ToBlock: big.NewInt(1), Topics: [][]common.Hash{}, }, nil, @@ -155,8 +154,8 @@ func TestToFilterArg(t *testing.T) { ethereum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, - FromBlock: rpc.NewRPCBlockNumber(1), - ToBlock: rpc.NewRPCBlockNumber(2), + FromBlock: big.NewInt(1), + ToBlock: big.NewInt(2), Topics: [][]common.Hash{}, }, nil, From f23245f4a598d441c35277de1e0739dadcc420b9 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 22:02:56 +0300 Subject: [PATCH 13/21] remove dev version --- go.mod | 2 +- go.sum | 4 ++-- rpc/types.go | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 0bbad498f98..fdfe2969a1f 100644 --- a/go.mod +++ b/go.mod @@ -75,7 +75,7 @@ require ( golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 - google.golang.org/grpc v1.33.0-dev + google.golang.org/grpc v1.31.1 google.golang.org/protobuf v1.25.0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce diff --git a/go.sum b/go.sum index 2ff2cd991e1..aac48be1c40 100644 --- a/go.sum +++ b/go.sum @@ -432,8 +432,8 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.0-dev h1:c0EY3sGPLj50wEdGQDpiS3zvk/zdduzrAkJTfa9ocjY= -google.golang.org/grpc v1.33.0-dev/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/rpc/types.go b/rpc/types.go index dc80d1f952b..413febbd68a 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -69,11 +69,6 @@ type jsonWriter interface { type BlockNumber int64 -func NewRPCBlockNumber(n int) *BlockNumber { - num := BlockNumber(n) - return &num -} - const ( PendingBlockNumber = BlockNumber(-2) LatestBlockNumber = BlockNumber(-1) From 9a1ef59b4dc96dceb7d27d9a88097563d00ae289 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 2 Sep 2020 23:34:52 +0300 Subject: [PATCH 14/21] it compiles --- go.mod | 7 +++++-- go.sum | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index fdfe2969a1f..3a502bd3c26 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/emicklei/dot v0.11.0 github.com/ethereum/evmc/v7 v7.3.0 github.com/fatih/color v1.7.0 + github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff github.com/gin-gonic/gin v1.6.2 github.com/go-ole/go-ole v1.2.4 // indirect @@ -43,6 +44,7 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 github.com/julienschmidt/httprouter v1.2.0 github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 + github.com/kevinburke/go-bindata v3.21.0+incompatible // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 github.com/ledgerwatch/lmdb-go v1.13.1-0.20200829020305-221d50cfedab @@ -75,8 +77,9 @@ require ( golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 - google.golang.org/grpc v1.31.1 - google.golang.org/protobuf v1.25.0 // indirect + google.golang.org/grpc v1.33.0-dev + google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe // indirect + google.golang.org/protobuf v1.25.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 diff --git a/go.sum b/go.sum index aac48be1c40..a67df7dd0cd 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,12 @@ github.com/ethereum/evmc/v7 v7.3.0 h1:4CsjJ+vSRrkzxOHeG1lFRGk4sG4/PgzXnWuRNgLGMJ github.com/ethereum/evmc/v7 v7.3.0/go.mod h1:q2Q0rCSUlIkngd+mZwfCzEUbvB0IIopH1+7hcs9QuDg= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f h1:Y/gg/utVetS+WS6htAKCTDralkm/8hLIIUAtLFdbdQ8= +github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f/go.mod h1:q+7Z5oyy8cvKF3TakcuihvQvBHFTnXjB+7UP1e2Q+1o= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -182,6 +186,7 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -204,6 +209,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= +github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -214,6 +221,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 h1:8e99Kuxoi+RnWCO8zD+ftp+rIuh9AYkZDRPmO8Xgp5k= @@ -260,6 +268,9 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= @@ -367,6 +378,7 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -375,6 +387,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -392,6 +405,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -418,6 +432,9 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9 h1:m9xhlkk2j+sO9WjAgNfTtl505MN7ZkuW69nOcBlp9qY= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -427,13 +444,19 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2El google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.2.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.0-dev h1:c0EY3sGPLj50wEdGQDpiS3zvk/zdduzrAkJTfa9ocjY= +google.golang.org/grpc v1.33.0-dev/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe h1:Wd/jb/cOPNfvxxUAejtru6/krTJyzX6aGV5GY7EcqI0= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -450,11 +473,13 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 1623cb4c6a2202f2700ed1c29c19cb438628d9fd Mon Sep 17 00:00:00 2001 From: Alexey Akhunov Date: Thu, 3 Sep 2020 07:01:30 +0100 Subject: [PATCH 15/21] mod tidy --- go.mod | 5 +---- go.sum | 24 ------------------------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 3a502bd3c26..0bbad498f98 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,6 @@ require ( github.com/emicklei/dot v0.11.0 github.com/ethereum/evmc/v7 v7.3.0 github.com/fatih/color v1.7.0 - github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff github.com/gin-gonic/gin v1.6.2 github.com/go-ole/go-ole v1.2.4 // indirect @@ -44,7 +43,6 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 github.com/julienschmidt/httprouter v1.2.0 github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 - github.com/kevinburke/go-bindata v3.21.0+incompatible // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 github.com/ledgerwatch/lmdb-go v1.13.1-0.20200829020305-221d50cfedab @@ -78,8 +76,7 @@ require ( golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 google.golang.org/grpc v1.33.0-dev - google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe // indirect - google.golang.org/protobuf v1.25.0 + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 diff --git a/go.sum b/go.sum index a67df7dd0cd..cbd517d5ac2 100644 --- a/go.sum +++ b/go.sum @@ -98,12 +98,8 @@ github.com/ethereum/evmc/v7 v7.3.0 h1:4CsjJ+vSRrkzxOHeG1lFRGk4sG4/PgzXnWuRNgLGMJ github.com/ethereum/evmc/v7 v7.3.0/go.mod h1:q2Q0rCSUlIkngd+mZwfCzEUbvB0IIopH1+7hcs9QuDg= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f h1:Y/gg/utVetS+WS6htAKCTDralkm/8hLIIUAtLFdbdQ8= -github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f/go.mod h1:q+7Z5oyy8cvKF3TakcuihvQvBHFTnXjB+7UP1e2Q+1o= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -186,7 +182,6 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -209,8 +204,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= -github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -221,7 +214,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 h1:8e99Kuxoi+RnWCO8zD+ftp+rIuh9AYkZDRPmO8Xgp5k= @@ -268,9 +260,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= @@ -378,7 +367,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -387,7 +375,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -405,7 +392,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -432,9 +418,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9 h1:m9xhlkk2j+sO9WjAgNfTtl505MN7ZkuW69nOcBlp9qY= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -444,19 +427,14 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2El google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/grpc v1.2.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.0-dev h1:c0EY3sGPLj50wEdGQDpiS3zvk/zdduzrAkJTfa9ocjY= google.golang.org/grpc v1.33.0-dev/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe h1:Wd/jb/cOPNfvxxUAejtru6/krTJyzX6aGV5GY7EcqI0= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200902070140-9a132e444fbe/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -473,13 +451,11 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From a109bb07943906ce3248fda64ea721ef218fe1cb Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 3 Sep 2020 09:29:21 +0700 Subject: [PATCH 16/21] fix bin deps --- cmd/hack/binary-deps/main.go | 23 +++++++++++++++++++++++ go.mod | 8 ++++++-- go.sum | 31 ++++++++++++++++++++++++++++--- 3 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 cmd/hack/binary-deps/main.go diff --git a/cmd/hack/binary-deps/main.go b/cmd/hack/binary-deps/main.go new file mode 100644 index 00000000000..f4b7d4ac3a0 --- /dev/null +++ b/cmd/hack/binary-deps/main.go @@ -0,0 +1,23 @@ +// +build trick_go_mod_tidy + +// This module is just a hack for 'go mod tidy' command +// +// Problem is - 'go mod tidy' removes from go.mod file lines if you don't use them in source code +// +// But code generators we use as binaries - not by including them into source code +// To provide reproducible builds - go.mod file must be source of truth about code generators version +// 'go mod tidy' will not remove binary deps from go.mod file if you add them here +// +// use `make devtools` - does install all binary deps of right version + +// build tag 'trick_go_mod_tidy' - is used to hide warnings of IDEA (because we can't import `main` packages in go) + +package main + +import ( + _ "github.com/fjl/gencodec" + _ "github.com/kevinburke/go-bindata" + _ "golang.org/x/tools/cmd/stringer" + _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" + _ "google.golang.org/protobuf/cmd/protoc-gen-go" +) diff --git a/go.mod b/go.mod index 0bbad498f98..77088d73146 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/emicklei/dot v0.11.0 github.com/ethereum/evmc/v7 v7.3.0 github.com/fatih/color v1.7.0 + github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff github.com/gin-gonic/gin v1.6.2 github.com/go-ole/go-ole v1.2.4 // indirect @@ -43,6 +44,7 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 github.com/julienschmidt/httprouter v1.2.0 github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 + github.com/kevinburke/go-bindata v3.21.0+incompatible github.com/kylelemons/godebug v1.1.0 // indirect github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 github.com/ledgerwatch/lmdb-go v1.13.1-0.20200829020305-221d50cfedab @@ -75,8 +77,10 @@ require ( golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 golang.org/x/text v0.3.2 golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 - google.golang.org/grpc v1.33.0-dev - google.golang.org/protobuf v1.25.0 // indirect + golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9 + google.golang.org/grpc v1.30.1 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200825174526-e13e057332a8 + google.golang.org/protobuf v1.25.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 diff --git a/go.sum b/go.sum index cbd517d5ac2..1e3e03311b4 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,12 @@ github.com/ethereum/evmc/v7 v7.3.0 h1:4CsjJ+vSRrkzxOHeG1lFRGk4sG4/PgzXnWuRNgLGMJ github.com/ethereum/evmc/v7 v7.3.0/go.mod h1:q2Q0rCSUlIkngd+mZwfCzEUbvB0IIopH1+7hcs9QuDg= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f h1:Y/gg/utVetS+WS6htAKCTDralkm/8hLIIUAtLFdbdQ8= +github.com/fjl/gencodec v0.0.0-20191126094850-e283372f291f/go.mod h1:q+7Z5oyy8cvKF3TakcuihvQvBHFTnXjB+7UP1e2Q+1o= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -182,6 +186,8 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -204,6 +210,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= +github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -214,6 +222,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/ledgerwatch/bolt v1.4.6-0.20200605053542-69293d8f1d33 h1:8e99Kuxoi+RnWCO8zD+ftp+rIuh9AYkZDRPmO8Xgp5k= @@ -260,6 +269,11 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= @@ -367,6 +381,7 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -375,6 +390,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -392,6 +408,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -418,6 +435,9 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9 h1:m9xhlkk2j+sO9WjAgNfTtl505MN7ZkuW69nOcBlp9qY= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -431,10 +451,11 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.0-dev h1:c0EY3sGPLj50wEdGQDpiS3zvk/zdduzrAkJTfa9ocjY= -google.golang.org/grpc v1.33.0-dev/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.30.1 h1:oJTcovwKSu7V3TaBKd0/AXOuJVHjTdGTutbMHIOgVEQ= +google.golang.org/grpc v1.30.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200825174526-e13e057332a8 h1:vhGLALbuAs4ReHPs+ON9Pxv+Nr8f1RFOmadtDGsTuFU= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200825174526-e13e057332a8/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -451,11 +472,15 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 0a4ccd31bcd37f9702f2ee4b5bd7144e3cf081a3 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 3 Sep 2020 09:30:35 +0700 Subject: [PATCH 17/21] use stable version of grpc --- ethdb/remote/db.pb.go | 410 ++++++++++------ ethdb/remote/db_grpc.pb.go | 130 ++--- ethdb/remote/ethbackend.pb.go | 739 +++++++++++++++++++---------- ethdb/remote/ethbackend_grpc.pb.go | 204 +++----- ethdb/remote/kv.pb.go | 393 +++++++++------ ethdb/remote/kv_grpc.pb.go | 99 ++-- 6 files changed, 1174 insertions(+), 801 deletions(-) diff --git a/ethdb/remote/db.pb.go b/ethdb/remote/db.pb.go index 422b0aba0e4..038af5ccdb3 100644 --- a/ethdb/remote/db.pb.go +++ b/ethdb/remote/db.pb.go @@ -1,195 +1,337 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: remote/db.proto package remote import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type SizeRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *SizeRequest) Reset() { *m = SizeRequest{} } -func (m *SizeRequest) String() string { return proto.CompactTextString(m) } -func (*SizeRequest) ProtoMessage() {} -func (*SizeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ab4915a3c5b6560d, []int{0} +func (x *SizeRequest) Reset() { + *x = SizeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SizeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SizeRequest.Unmarshal(m, b) -} -func (m *SizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SizeRequest.Marshal(b, m, deterministic) -} -func (m *SizeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SizeRequest.Merge(m, src) -} -func (m *SizeRequest) XXX_Size() int { - return xxx_messageInfo_SizeRequest.Size(m) -} -func (m *SizeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SizeRequest.DiscardUnknown(m) +func (x *SizeRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_SizeRequest proto.InternalMessageInfo +func (*SizeRequest) ProtoMessage() {} -type SizeReply struct { - Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *SizeRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_db_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *SizeReply) Reset() { *m = SizeReply{} } -func (m *SizeReply) String() string { return proto.CompactTextString(m) } -func (*SizeReply) ProtoMessage() {} -func (*SizeReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ab4915a3c5b6560d, []int{1} +// Deprecated: Use SizeRequest.ProtoReflect.Descriptor instead. +func (*SizeRequest) Descriptor() ([]byte, []int) { + return file_remote_db_proto_rawDescGZIP(), []int{0} } -func (m *SizeReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SizeReply.Unmarshal(m, b) -} -func (m *SizeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SizeReply.Marshal(b, m, deterministic) +type SizeReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` } -func (m *SizeReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_SizeReply.Merge(m, src) + +func (x *SizeReply) Reset() { + *x = SizeReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SizeReply) XXX_Size() int { - return xxx_messageInfo_SizeReply.Size(m) + +func (x *SizeReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SizeReply) XXX_DiscardUnknown() { - xxx_messageInfo_SizeReply.DiscardUnknown(m) + +func (*SizeReply) ProtoMessage() {} + +func (x *SizeReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_db_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SizeReply proto.InternalMessageInfo +// Deprecated: Use SizeReply.ProtoReflect.Descriptor instead. +func (*SizeReply) Descriptor() ([]byte, []int) { + return file_remote_db_proto_rawDescGZIP(), []int{1} +} -func (m *SizeReply) GetSize() uint64 { - if m != nil { - return m.Size +func (x *SizeReply) GetSize() uint64 { + if x != nil { + return x.Size } return 0 } type BucketSizeRequest struct { - BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BucketSizeRequest) Reset() { *m = BucketSizeRequest{} } -func (m *BucketSizeRequest) String() string { return proto.CompactTextString(m) } -func (*BucketSizeRequest) ProtoMessage() {} -func (*BucketSizeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ab4915a3c5b6560d, []int{2} + BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` } -func (m *BucketSizeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BucketSizeRequest.Unmarshal(m, b) -} -func (m *BucketSizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BucketSizeRequest.Marshal(b, m, deterministic) -} -func (m *BucketSizeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BucketSizeRequest.Merge(m, src) +func (x *BucketSizeRequest) Reset() { + *x = BucketSizeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_db_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BucketSizeRequest) XXX_Size() int { - return xxx_messageInfo_BucketSizeRequest.Size(m) + +func (x *BucketSizeRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BucketSizeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BucketSizeRequest.DiscardUnknown(m) + +func (*BucketSizeRequest) ProtoMessage() {} + +func (x *BucketSizeRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_db_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BucketSizeRequest proto.InternalMessageInfo +// Deprecated: Use BucketSizeRequest.ProtoReflect.Descriptor instead. +func (*BucketSizeRequest) Descriptor() ([]byte, []int) { + return file_remote_db_proto_rawDescGZIP(), []int{2} +} -func (m *BucketSizeRequest) GetBucketName() string { - if m != nil { - return m.BucketName +func (x *BucketSizeRequest) GetBucketName() string { + if x != nil { + return x.BucketName } return "" } type BucketSizeReply struct { - Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` } -func (m *BucketSizeReply) Reset() { *m = BucketSizeReply{} } -func (m *BucketSizeReply) String() string { return proto.CompactTextString(m) } -func (*BucketSizeReply) ProtoMessage() {} -func (*BucketSizeReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ab4915a3c5b6560d, []int{3} +func (x *BucketSizeReply) Reset() { + *x = BucketSizeReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_db_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BucketSizeReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BucketSizeReply.Unmarshal(m, b) +func (x *BucketSizeReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BucketSizeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BucketSizeReply.Marshal(b, m, deterministic) + +func (*BucketSizeReply) ProtoMessage() {} + +func (x *BucketSizeReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_db_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *BucketSizeReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_BucketSizeReply.Merge(m, src) + +// Deprecated: Use BucketSizeReply.ProtoReflect.Descriptor instead. +func (*BucketSizeReply) Descriptor() ([]byte, []int) { + return file_remote_db_proto_rawDescGZIP(), []int{3} } -func (m *BucketSizeReply) XXX_Size() int { - return xxx_messageInfo_BucketSizeReply.Size(m) + +func (x *BucketSizeReply) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 } -func (m *BucketSizeReply) XXX_DiscardUnknown() { - xxx_messageInfo_BucketSizeReply.DiscardUnknown(m) + +var File_remote_db_proto protoreflect.FileDescriptor + +var file_remote_db_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x69, 0x7a, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1f, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x33, 0x0a, 0x11, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, + 0x0a, 0x0f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x32, 0x76, 0x0a, 0x02, 0x44, 0x42, 0x12, 0x2e, 0x0a, 0x04, 0x53, + 0x69, 0x7a, 0x65, 0x12, 0x13, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x69, 0x7a, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x29, 0x0a, + 0x10, 0x69, 0x6f, 0x2e, 0x74, 0x75, 0x72, 0x62, 0x6f, 0x2d, 0x67, 0x65, 0x74, 0x68, 0x2e, 0x64, + 0x62, 0x42, 0x02, 0x44, 0x42, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_BucketSizeReply proto.InternalMessageInfo +var ( + file_remote_db_proto_rawDescOnce sync.Once + file_remote_db_proto_rawDescData = file_remote_db_proto_rawDesc +) -func (m *BucketSizeReply) GetSize() uint64 { - if m != nil { - return m.Size - } - return 0 +func file_remote_db_proto_rawDescGZIP() []byte { + file_remote_db_proto_rawDescOnce.Do(func() { + file_remote_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_remote_db_proto_rawDescData) + }) + return file_remote_db_proto_rawDescData +} + +var file_remote_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_remote_db_proto_goTypes = []interface{}{ + (*SizeRequest)(nil), // 0: remote.SizeRequest + (*SizeReply)(nil), // 1: remote.SizeReply + (*BucketSizeRequest)(nil), // 2: remote.BucketSizeRequest + (*BucketSizeReply)(nil), // 3: remote.BucketSizeReply +} +var file_remote_db_proto_depIdxs = []int32{ + 0, // 0: remote.DB.Size:input_type -> remote.SizeRequest + 2, // 1: remote.DB.BucketSize:input_type -> remote.BucketSizeRequest + 1, // 2: remote.DB.Size:output_type -> remote.SizeReply + 3, // 3: remote.DB.BucketSize:output_type -> remote.BucketSizeReply + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { - proto.RegisterType((*SizeRequest)(nil), "remote.SizeRequest") - proto.RegisterType((*SizeReply)(nil), "remote.SizeReply") - proto.RegisterType((*BucketSizeRequest)(nil), "remote.BucketSizeRequest") - proto.RegisterType((*BucketSizeReply)(nil), "remote.BucketSizeReply") -} - -func init() { proto.RegisterFile("remote/db.proto", fileDescriptor_ab4915a3c5b6560d) } - -var fileDescriptor_ab4915a3c5b6560d = []byte{ - // 207 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x4a, 0xcd, 0xcd, - 0x2f, 0x49, 0xd5, 0x4f, 0x49, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0x08, 0x28, - 0xf1, 0x72, 0x71, 0x07, 0x67, 0x56, 0xa5, 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0xc9, - 0x73, 0x71, 0x42, 0xb8, 0x05, 0x39, 0x95, 0x42, 0x42, 0x5c, 0x2c, 0xc5, 0x99, 0x55, 0xa9, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x60, 0xb6, 0x92, 0x31, 0x97, 0xa0, 0x53, 0x69, 0x72, 0x76, - 0x6a, 0x09, 0x92, 0x2e, 0x21, 0x39, 0x2e, 0xae, 0x24, 0xb0, 0xa0, 0x5f, 0x62, 0x2e, 0x44, 0x39, - 0x67, 0x10, 0x92, 0x88, 0x92, 0x2a, 0x17, 0x3f, 0xb2, 0x26, 0x1c, 0x66, 0x1b, 0x95, 0x71, 0x31, - 0xb9, 0x38, 0x09, 0xe9, 0x71, 0xb1, 0x80, 0x94, 0x09, 0x09, 0xeb, 0x41, 0x9c, 0xa8, 0x87, 0x64, - 0x93, 0x94, 0x20, 0xaa, 0x20, 0xc8, 0x24, 0x07, 0x2e, 0x2e, 0x84, 0xe1, 0x42, 0x92, 0x30, 0x05, - 0x18, 0xae, 0x94, 0x12, 0xc7, 0x26, 0x55, 0x90, 0x53, 0xe9, 0xa4, 0xc9, 0x25, 0x90, 0x99, 0xaf, - 0x57, 0x52, 0x5a, 0x94, 0x94, 0xaf, 0x9b, 0x9e, 0x5a, 0x92, 0xa1, 0x97, 0x92, 0xe4, 0xc4, 0xe4, - 0xe2, 0x14, 0xc0, 0x18, 0xc5, 0xaf, 0xa7, 0x0f, 0xd1, 0x63, 0x0d, 0xa1, 0x92, 0xd8, 0xc0, 0xa1, - 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x9a, 0xd7, 0x6d, 0x50, 0x01, 0x00, 0x00, +func init() { file_remote_db_proto_init() } +func file_remote_db_proto_init() { + if File_remote_db_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_remote_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SizeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SizeReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BucketSizeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BucketSizeReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_remote_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_remote_db_proto_goTypes, + DependencyIndexes: file_remote_db_proto_depIdxs, + MessageInfos: file_remote_db_proto_msgTypes, + }.Build() + File_remote_db_proto = out.File + file_remote_db_proto_rawDesc = nil + file_remote_db_proto_goTypes = nil + file_remote_db_proto_depIdxs = nil } diff --git a/ethdb/remote/db_grpc.pb.go b/ethdb/remote/db_grpc.pb.go index 91a799a6457..6aa4788e669 100644 --- a/ethdb/remote/db_grpc.pb.go +++ b/ethdb/remote/db_grpc.pb.go @@ -11,7 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion7 +const _ = grpc.SupportPackageIsVersion6 // DBClient is the client API for DB service. // @@ -29,10 +29,6 @@ func NewDBClient(cc grpc.ClientConnInterface) DBClient { return &dBClient{cc} } -var dBSizeStreamDesc = &grpc.StreamDesc{ - StreamName: "Size", -} - func (c *dBClient) Size(ctx context.Context, in *SizeRequest, opts ...grpc.CallOption) (*SizeReply, error) { out := new(SizeReply) err := c.cc.Invoke(ctx, "/remote.DB/Size", in, out, opts...) @@ -42,10 +38,6 @@ func (c *dBClient) Size(ctx context.Context, in *SizeRequest, opts ...grpc.CallO return out, nil } -var dBBucketSizeStreamDesc = &grpc.StreamDesc{ - StreamName: "BucketSize", -} - func (c *dBClient) BucketSize(ctx context.Context, in *BucketSizeRequest, opts ...grpc.CallOption) (*BucketSizeReply, error) { out := new(BucketSizeReply) err := c.cc.Invoke(ctx, "/remote.DB/BucketSize", in, out, opts...) @@ -55,108 +47,80 @@ func (c *dBClient) BucketSize(ctx context.Context, in *BucketSizeRequest, opts . return out, nil } -// DBService is the service API for DB service. -// Fields should be assigned to their respective handler implementations only before -// RegisterDBService is called. Any unassigned fields will result in the -// handler for that method returning an Unimplemented error. -type DBService struct { - Size func(context.Context, *SizeRequest) (*SizeReply, error) - BucketSize func(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) +// DBServer is the server API for DB service. +// All implementations must embed UnimplementedDBServer +// for forward compatibility +type DBServer interface { + Size(context.Context, *SizeRequest) (*SizeReply, error) + BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) + mustEmbedUnimplementedDBServer() +} + +// UnimplementedDBServer must be embedded to have forward compatible implementations. +type UnimplementedDBServer struct { +} + +func (*UnimplementedDBServer) Size(context.Context, *SizeRequest) (*SizeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Size not implemented") +} +func (*UnimplementedDBServer) BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BucketSize not implemented") } +func (*UnimplementedDBServer) mustEmbedUnimplementedDBServer() {} -func (s *DBService) size(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func RegisterDBServer(s *grpc.Server, srv DBServer) { + s.RegisterService(&_DB_serviceDesc, srv) +} + +func _DB_Size_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SizeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.Size(ctx, in) + return srv.(DBServer).Size(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/remote.DB/Size", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.Size(ctx, req.(*SizeRequest)) + return srv.(DBServer).Size(ctx, req.(*SizeRequest)) } return interceptor(ctx, in, info, handler) } -func (s *DBService) bucketSize(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _DB_BucketSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BucketSizeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.BucketSize(ctx, in) + return srv.(DBServer).BucketSize(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/remote.DB/BucketSize", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.BucketSize(ctx, req.(*BucketSizeRequest)) + return srv.(DBServer).BucketSize(ctx, req.(*BucketSizeRequest)) } return interceptor(ctx, in, info, handler) } -// RegisterDBService registers a service implementation with a gRPC server. -func RegisterDBService(s grpc.ServiceRegistrar, srv *DBService) { - srvCopy := *srv - if srvCopy.Size == nil { - srvCopy.Size = func(context.Context, *SizeRequest) (*SizeReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Size not implemented") - } - } - if srvCopy.BucketSize == nil { - srvCopy.BucketSize = func(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method BucketSize not implemented") - } - } - sd := grpc.ServiceDesc{ - ServiceName: "remote.DB", - Methods: []grpc.MethodDesc{ - { - MethodName: "Size", - Handler: srvCopy.size, - }, - { - MethodName: "BucketSize", - Handler: srvCopy.bucketSize, - }, +var _DB_serviceDesc = grpc.ServiceDesc{ + ServiceName: "remote.DB", + HandlerType: (*DBServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Size", + Handler: _DB_Size_Handler, }, - Streams: []grpc.StreamDesc{}, - Metadata: "remote/db.proto", - } - - s.RegisterService(&sd, nil) -} - -// NewDBService creates a new DBService containing the -// implemented methods of the DB service in s. Any unimplemented -// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. -// This includes situations where the method handler is misspelled or has the wrong -// signature. For this reason, this function should be used with great care and -// is not recommended to be used by most users. -func NewDBService(s interface{}) *DBService { - ns := &DBService{} - if h, ok := s.(interface { - Size(context.Context, *SizeRequest) (*SizeReply, error) - }); ok { - ns.Size = h.Size - } - if h, ok := s.(interface { - BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) - }); ok { - ns.BucketSize = h.BucketSize - } - return ns -} - -// UnstableDBService is the service API for DB service. -// New methods may be added to this interface if they are added to the service -// definition, which is not a backward-compatible change. For this reason, -// use of this type is not recommended. -type UnstableDBService interface { - Size(context.Context, *SizeRequest) (*SizeReply, error) - BucketSize(context.Context, *BucketSizeRequest) (*BucketSizeReply, error) + { + MethodName: "BucketSize", + Handler: _DB_BucketSize_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "remote/db.proto", } diff --git a/ethdb/remote/ethbackend.pb.go b/ethdb/remote/ethbackend.pb.go index dd32b989ab8..8d1ab1a4194 100644 --- a/ethdb/remote/ethbackend.pb.go +++ b/ethdb/remote/ethbackend.pb.go @@ -1,364 +1,599 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: remote/ethbackend.proto package remote import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type TxRequest struct { - Signedtx []byte `protobuf:"bytes,1,opt,name=signedtx,proto3" json:"signedtx,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TxRequest) Reset() { *m = TxRequest{} } -func (m *TxRequest) String() string { return proto.CompactTextString(m) } -func (*TxRequest) ProtoMessage() {} -func (*TxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{0} + Signedtx []byte `protobuf:"bytes,1,opt,name=signedtx,proto3" json:"signedtx,omitempty"` } -func (m *TxRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxRequest.Unmarshal(m, b) -} -func (m *TxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxRequest.Marshal(b, m, deterministic) -} -func (m *TxRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxRequest.Merge(m, src) +func (x *TxRequest) Reset() { + *x = TxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxRequest) XXX_Size() int { - return xxx_messageInfo_TxRequest.Size(m) + +func (x *TxRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TxRequest.DiscardUnknown(m) + +func (*TxRequest) ProtoMessage() {} + +func (x *TxRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxRequest proto.InternalMessageInfo +// Deprecated: Use TxRequest.ProtoReflect.Descriptor instead. +func (*TxRequest) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{0} +} -func (m *TxRequest) GetSignedtx() []byte { - if m != nil { - return m.Signedtx +func (x *TxRequest) GetSignedtx() []byte { + if x != nil { + return x.Signedtx } return nil } type AddReply struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AddReply) Reset() { *m = AddReply{} } -func (m *AddReply) String() string { return proto.CompactTextString(m) } -func (*AddReply) ProtoMessage() {} -func (*AddReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{1} + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` } -func (m *AddReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddReply.Unmarshal(m, b) -} -func (m *AddReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddReply.Marshal(b, m, deterministic) -} -func (m *AddReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddReply.Merge(m, src) +func (x *AddReply) Reset() { + *x = AddReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AddReply) XXX_Size() int { - return xxx_messageInfo_AddReply.Size(m) + +func (x *AddReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddReply) XXX_DiscardUnknown() { - xxx_messageInfo_AddReply.DiscardUnknown(m) + +func (*AddReply) ProtoMessage() {} + +func (x *AddReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddReply proto.InternalMessageInfo +// Deprecated: Use AddReply.ProtoReflect.Descriptor instead. +func (*AddReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{1} +} -func (m *AddReply) GetHash() []byte { - if m != nil { - return m.Hash +func (x *AddReply) GetHash() []byte { + if x != nil { + return x.Hash } return nil } type BloomStatusRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *BloomStatusRequest) Reset() { *m = BloomStatusRequest{} } -func (m *BloomStatusRequest) String() string { return proto.CompactTextString(m) } -func (*BloomStatusRequest) ProtoMessage() {} -func (*BloomStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{2} +func (x *BloomStatusRequest) Reset() { + *x = BloomStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BloomStatusRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BloomStatusRequest.Unmarshal(m, b) -} -func (m *BloomStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BloomStatusRequest.Marshal(b, m, deterministic) -} -func (m *BloomStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BloomStatusRequest.Merge(m, src) -} -func (m *BloomStatusRequest) XXX_Size() int { - return xxx_messageInfo_BloomStatusRequest.Size(m) -} -func (m *BloomStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BloomStatusRequest.DiscardUnknown(m) +func (x *BloomStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_BloomStatusRequest proto.InternalMessageInfo +func (*BloomStatusRequest) ProtoMessage() {} -type BloomStatusReply struct { - Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - Sections uint64 `protobuf:"varint,2,opt,name=sections,proto3" json:"sections,omitempty"` - Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *BloomStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *BloomStatusReply) Reset() { *m = BloomStatusReply{} } -func (m *BloomStatusReply) String() string { return proto.CompactTextString(m) } -func (*BloomStatusReply) ProtoMessage() {} -func (*BloomStatusReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{3} +// Deprecated: Use BloomStatusRequest.ProtoReflect.Descriptor instead. +func (*BloomStatusRequest) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{2} } -func (m *BloomStatusReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BloomStatusReply.Unmarshal(m, b) -} -func (m *BloomStatusReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BloomStatusReply.Marshal(b, m, deterministic) +type BloomStatusReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Size uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + Sections uint64 `protobuf:"varint,2,opt,name=sections,proto3" json:"sections,omitempty"` + Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` } -func (m *BloomStatusReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_BloomStatusReply.Merge(m, src) + +func (x *BloomStatusReply) Reset() { + *x = BloomStatusReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BloomStatusReply) XXX_Size() int { - return xxx_messageInfo_BloomStatusReply.Size(m) + +func (x *BloomStatusReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BloomStatusReply) XXX_DiscardUnknown() { - xxx_messageInfo_BloomStatusReply.DiscardUnknown(m) + +func (*BloomStatusReply) ProtoMessage() {} + +func (x *BloomStatusReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BloomStatusReply proto.InternalMessageInfo +// Deprecated: Use BloomStatusReply.ProtoReflect.Descriptor instead. +func (*BloomStatusReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{3} +} -func (m *BloomStatusReply) GetSize() uint64 { - if m != nil { - return m.Size +func (x *BloomStatusReply) GetSize() uint64 { + if x != nil { + return x.Size } return 0 } -func (m *BloomStatusReply) GetSections() uint64 { - if m != nil { - return m.Sections +func (x *BloomStatusReply) GetSections() uint64 { + if x != nil { + return x.Sections } return 0 } -func (m *BloomStatusReply) GetHash() []byte { - if m != nil { - return m.Hash +func (x *BloomStatusReply) GetHash() []byte { + if x != nil { + return x.Hash } return nil } type EtherbaseRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *EtherbaseRequest) Reset() { *m = EtherbaseRequest{} } -func (m *EtherbaseRequest) String() string { return proto.CompactTextString(m) } -func (*EtherbaseRequest) ProtoMessage() {} -func (*EtherbaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{4} +func (x *EtherbaseRequest) Reset() { + *x = EtherbaseRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *EtherbaseRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EtherbaseRequest.Unmarshal(m, b) -} -func (m *EtherbaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EtherbaseRequest.Marshal(b, m, deterministic) -} -func (m *EtherbaseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EtherbaseRequest.Merge(m, src) -} -func (m *EtherbaseRequest) XXX_Size() int { - return xxx_messageInfo_EtherbaseRequest.Size(m) -} -func (m *EtherbaseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EtherbaseRequest.DiscardUnknown(m) +func (x *EtherbaseRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_EtherbaseRequest proto.InternalMessageInfo +func (*EtherbaseRequest) ProtoMessage() {} -type EtherbaseReply struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *EtherbaseRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *EtherbaseReply) Reset() { *m = EtherbaseReply{} } -func (m *EtherbaseReply) String() string { return proto.CompactTextString(m) } -func (*EtherbaseReply) ProtoMessage() {} -func (*EtherbaseReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{5} +// Deprecated: Use EtherbaseRequest.ProtoReflect.Descriptor instead. +func (*EtherbaseRequest) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{4} } -func (m *EtherbaseReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EtherbaseReply.Unmarshal(m, b) -} -func (m *EtherbaseReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EtherbaseReply.Marshal(b, m, deterministic) +type EtherbaseReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` } -func (m *EtherbaseReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_EtherbaseReply.Merge(m, src) + +func (x *EtherbaseReply) Reset() { + *x = EtherbaseReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *EtherbaseReply) XXX_Size() int { - return xxx_messageInfo_EtherbaseReply.Size(m) + +func (x *EtherbaseReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EtherbaseReply) XXX_DiscardUnknown() { - xxx_messageInfo_EtherbaseReply.DiscardUnknown(m) + +func (*EtherbaseReply) ProtoMessage() {} + +func (x *EtherbaseReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_EtherbaseReply proto.InternalMessageInfo +// Deprecated: Use EtherbaseReply.ProtoReflect.Descriptor instead. +func (*EtherbaseReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{5} +} -func (m *EtherbaseReply) GetHash() []byte { - if m != nil { - return m.Hash +func (x *EtherbaseReply) GetHash() []byte { + if x != nil { + return x.Hash } return nil } type NetVersionRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *NetVersionRequest) Reset() { *m = NetVersionRequest{} } -func (m *NetVersionRequest) String() string { return proto.CompactTextString(m) } -func (*NetVersionRequest) ProtoMessage() {} -func (*NetVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{6} +func (x *NetVersionRequest) Reset() { + *x = NetVersionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NetVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NetVersionRequest.Unmarshal(m, b) -} -func (m *NetVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NetVersionRequest.Marshal(b, m, deterministic) -} -func (m *NetVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetVersionRequest.Merge(m, src) -} -func (m *NetVersionRequest) XXX_Size() int { - return xxx_messageInfo_NetVersionRequest.Size(m) -} -func (m *NetVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NetVersionRequest.DiscardUnknown(m) +func (x *NetVersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_NetVersionRequest proto.InternalMessageInfo +func (*NetVersionRequest) ProtoMessage() {} -type NetVersionReply struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *NetVersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *NetVersionReply) Reset() { *m = NetVersionReply{} } -func (m *NetVersionReply) String() string { return proto.CompactTextString(m) } -func (*NetVersionReply) ProtoMessage() {} -func (*NetVersionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4527a6acc4e6161e, []int{7} +// Deprecated: Use NetVersionRequest.ProtoReflect.Descriptor instead. +func (*NetVersionRequest) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{6} } -func (m *NetVersionReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NetVersionReply.Unmarshal(m, b) -} -func (m *NetVersionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NetVersionReply.Marshal(b, m, deterministic) +type NetVersionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *NetVersionReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetVersionReply.Merge(m, src) + +func (x *NetVersionReply) Reset() { + *x = NetVersionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NetVersionReply) XXX_Size() int { - return xxx_messageInfo_NetVersionReply.Size(m) + +func (x *NetVersionReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NetVersionReply) XXX_DiscardUnknown() { - xxx_messageInfo_NetVersionReply.DiscardUnknown(m) + +func (*NetVersionReply) ProtoMessage() {} + +func (x *NetVersionReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NetVersionReply proto.InternalMessageInfo +// Deprecated: Use NetVersionReply.ProtoReflect.Descriptor instead. +func (*NetVersionReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{7} +} -func (m *NetVersionReply) GetId() uint64 { - if m != nil { - return m.Id +func (x *NetVersionReply) GetId() uint64 { + if x != nil { + return x.Id } return 0 } -func init() { - proto.RegisterType((*TxRequest)(nil), "remote.TxRequest") - proto.RegisterType((*AddReply)(nil), "remote.AddReply") - proto.RegisterType((*BloomStatusRequest)(nil), "remote.BloomStatusRequest") - proto.RegisterType((*BloomStatusReply)(nil), "remote.BloomStatusReply") - proto.RegisterType((*EtherbaseRequest)(nil), "remote.EtherbaseRequest") - proto.RegisterType((*EtherbaseReply)(nil), "remote.EtherbaseReply") - proto.RegisterType((*NetVersionRequest)(nil), "remote.NetVersionRequest") - proto.RegisterType((*NetVersionReply)(nil), "remote.NetVersionReply") -} - -func init() { proto.RegisterFile("remote/ethbackend.proto", fileDescriptor_4527a6acc4e6161e) } - -var fileDescriptor_4527a6acc4e6161e = []byte{ - // 337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcf, 0x4b, 0xf3, 0x40, - 0x14, 0x24, 0x6d, 0x29, 0xed, 0xfb, 0x3e, 0xda, 0x74, 0x15, 0x1b, 0x73, 0x10, 0x0d, 0x82, 0x22, - 0x98, 0xa2, 0x1e, 0x45, 0xb0, 0xa9, 0x05, 0x41, 0x28, 0x12, 0x4b, 0x0f, 0xde, 0x92, 0xee, 0xa3, - 0x59, 0x6c, 0xb3, 0x35, 0xfb, 0x0a, 0xad, 0x7f, 0xbc, 0x48, 0xf3, 0xcb, 0x68, 0xe3, 0x29, 0xbb, - 0x33, 0x6f, 0x76, 0x26, 0xb3, 0x0b, 0xdd, 0x08, 0x17, 0x92, 0xb0, 0x87, 0x14, 0xf8, 0xde, 0xf4, - 0x0d, 0x43, 0x6e, 0x2f, 0x23, 0x49, 0x92, 0xd5, 0x13, 0xc2, 0x3a, 0x83, 0xe6, 0x78, 0xed, 0xe2, - 0xfb, 0x0a, 0x15, 0x31, 0x13, 0x1a, 0x4a, 0xcc, 0x42, 0xe4, 0xb4, 0x36, 0xb4, 0x63, 0xed, 0xfc, - 0xbf, 0x9b, 0xef, 0xad, 0x23, 0x68, 0xf4, 0x39, 0x77, 0x71, 0x39, 0xdf, 0x30, 0x06, 0xb5, 0xc0, - 0x53, 0x41, 0x3a, 0x13, 0xaf, 0xad, 0x7d, 0x60, 0xce, 0x5c, 0xca, 0xc5, 0x0b, 0x79, 0xb4, 0x52, - 0xe9, 0x89, 0xd6, 0x04, 0xf4, 0x1f, 0x68, 0xaa, 0x56, 0xe2, 0x03, 0x63, 0x75, 0xcd, 0x8d, 0xd7, - 0xb1, 0x33, 0x4e, 0x49, 0xc8, 0x50, 0x19, 0x95, 0x18, 0xcf, 0xf7, 0xb9, 0x5b, 0xb5, 0xe0, 0xc6, - 0x40, 0x1f, 0x52, 0x80, 0x91, 0xef, 0x29, 0xcc, 0xbc, 0x4e, 0xa1, 0x55, 0xc0, 0xfe, 0xca, 0xb9, - 0x07, 0x9d, 0x11, 0xd2, 0x04, 0x23, 0x25, 0x64, 0x98, 0x49, 0x4f, 0xa0, 0x5d, 0x04, 0xb7, 0xda, - 0x16, 0x54, 0x04, 0x4f, 0x33, 0x56, 0x04, 0xbf, 0xfe, 0xd4, 0x00, 0x86, 0xe3, 0x47, 0xa7, 0x3f, - 0x78, 0x1a, 0x8e, 0x1e, 0xd8, 0x05, 0x54, 0xfb, 0x9c, 0xb3, 0x8e, 0x9d, 0xf4, 0x68, 0xe7, 0x25, - 0x9a, 0x7a, 0x06, 0xe5, 0x75, 0xdd, 0x41, 0x33, 0x0f, 0xc6, 0x8c, 0x8c, 0xfe, 0x9d, 0xdf, 0x3c, - 0x28, 0x61, 0xb6, 0xf2, 0x7b, 0x80, 0xef, 0x70, 0xec, 0x30, 0x9b, 0xda, 0xf9, 0x0b, 0xb3, 0x5b, - 0x46, 0x6d, 0x4f, 0x18, 0xc0, 0xbf, 0xc2, 0x2d, 0x30, 0x33, 0x9b, 0xdb, 0xbd, 0x30, 0xd3, 0x28, - 0xe5, 0x96, 0xf3, 0x8d, 0x73, 0x05, 0xba, 0x90, 0x36, 0xad, 0x22, 0x5f, 0x5e, 0xce, 0x90, 0x02, - 0x9b, 0xfb, 0x4e, 0xa1, 0x91, 0x67, 0xed, 0xb5, 0x6d, 0xf7, 0x12, 0xf1, 0x6d, 0xf2, 0xf1, 0xeb, - 0xf1, 0x5b, 0xbb, 0xf9, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xa7, 0x70, 0x03, 0x86, 0x02, 0x00, - 0x00, +var File_remote_ethbackend_proto protoreflect.FileDescriptor + +var file_remote_ethbackend_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x65, 0x74, 0x68, 0x62, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x22, 0x27, 0x0a, 0x09, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x74, 0x78, 0x22, 0x1e, 0x0a, 0x08, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x14, 0x0a, 0x12, 0x42, 0x6c, + 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x56, 0x0a, 0x10, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x12, 0x0a, 0x10, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x24, 0x0a, 0x0e, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x21, 0x0a, 0x0f, 0x4e, 0x65, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x32, 0xfe, 0x01, 0x0a, 0x0a, 0x45, + 0x54, 0x48, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x12, 0x2a, 0x0a, 0x03, 0x41, 0x64, 0x64, + 0x12, 0x11, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, + 0x73, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x43, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, + 0x6c, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x31, 0x0a, 0x10, 0x69, + 0x6f, 0x2e, 0x74, 0x75, 0x72, 0x62, 0x6f, 0x2d, 0x67, 0x65, 0x74, 0x68, 0x2e, 0x64, 0x62, 0x42, + 0x0a, 0x45, 0x54, 0x48, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x50, 0x01, 0x5a, 0x0f, 0x2e, + 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_remote_ethbackend_proto_rawDescOnce sync.Once + file_remote_ethbackend_proto_rawDescData = file_remote_ethbackend_proto_rawDesc +) + +func file_remote_ethbackend_proto_rawDescGZIP() []byte { + file_remote_ethbackend_proto_rawDescOnce.Do(func() { + file_remote_ethbackend_proto_rawDescData = protoimpl.X.CompressGZIP(file_remote_ethbackend_proto_rawDescData) + }) + return file_remote_ethbackend_proto_rawDescData +} + +var file_remote_ethbackend_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_remote_ethbackend_proto_goTypes = []interface{}{ + (*TxRequest)(nil), // 0: remote.TxRequest + (*AddReply)(nil), // 1: remote.AddReply + (*BloomStatusRequest)(nil), // 2: remote.BloomStatusRequest + (*BloomStatusReply)(nil), // 3: remote.BloomStatusReply + (*EtherbaseRequest)(nil), // 4: remote.EtherbaseRequest + (*EtherbaseReply)(nil), // 5: remote.EtherbaseReply + (*NetVersionRequest)(nil), // 6: remote.NetVersionRequest + (*NetVersionReply)(nil), // 7: remote.NetVersionReply +} +var file_remote_ethbackend_proto_depIdxs = []int32{ + 0, // 0: remote.ETHBACKEND.Add:input_type -> remote.TxRequest + 4, // 1: remote.ETHBACKEND.Etherbase:input_type -> remote.EtherbaseRequest + 6, // 2: remote.ETHBACKEND.NetVersion:input_type -> remote.NetVersionRequest + 2, // 3: remote.ETHBACKEND.BloomStatus:input_type -> remote.BloomStatusRequest + 1, // 4: remote.ETHBACKEND.Add:output_type -> remote.AddReply + 5, // 5: remote.ETHBACKEND.Etherbase:output_type -> remote.EtherbaseReply + 7, // 6: remote.ETHBACKEND.NetVersion:output_type -> remote.NetVersionReply + 3, // 7: remote.ETHBACKEND.BloomStatus:output_type -> remote.BloomStatusReply + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_remote_ethbackend_proto_init() } +func file_remote_ethbackend_proto_init() { + if File_remote_ethbackend_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_remote_ethbackend_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BloomStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BloomStatusReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EtherbaseRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EtherbaseReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetVersionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetVersionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_remote_ethbackend_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_remote_ethbackend_proto_goTypes, + DependencyIndexes: file_remote_ethbackend_proto_depIdxs, + MessageInfos: file_remote_ethbackend_proto_msgTypes, + }.Build() + File_remote_ethbackend_proto = out.File + file_remote_ethbackend_proto_rawDesc = nil + file_remote_ethbackend_proto_goTypes = nil + file_remote_ethbackend_proto_depIdxs = nil } diff --git a/ethdb/remote/ethbackend_grpc.pb.go b/ethdb/remote/ethbackend_grpc.pb.go index e47c496dfce..b0d376e81f4 100644 --- a/ethdb/remote/ethbackend_grpc.pb.go +++ b/ethdb/remote/ethbackend_grpc.pb.go @@ -11,7 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion7 +const _ = grpc.SupportPackageIsVersion6 // ETHBACKENDClient is the client API for ETHBACKEND service. // @@ -31,10 +31,6 @@ func NewETHBACKENDClient(cc grpc.ClientConnInterface) ETHBACKENDClient { return &eTHBACKENDClient{cc} } -var eTHBACKENDAddStreamDesc = &grpc.StreamDesc{ - StreamName: "Add", -} - func (c *eTHBACKENDClient) Add(ctx context.Context, in *TxRequest, opts ...grpc.CallOption) (*AddReply, error) { out := new(AddReply) err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/Add", in, out, opts...) @@ -44,10 +40,6 @@ func (c *eTHBACKENDClient) Add(ctx context.Context, in *TxRequest, opts ...grpc. return out, nil } -var eTHBACKENDEtherbaseStreamDesc = &grpc.StreamDesc{ - StreamName: "Etherbase", -} - func (c *eTHBACKENDClient) Etherbase(ctx context.Context, in *EtherbaseRequest, opts ...grpc.CallOption) (*EtherbaseReply, error) { out := new(EtherbaseReply) err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/Etherbase", in, out, opts...) @@ -57,10 +49,6 @@ func (c *eTHBACKENDClient) Etherbase(ctx context.Context, in *EtherbaseRequest, return out, nil } -var eTHBACKENDNetVersionStreamDesc = &grpc.StreamDesc{ - StreamName: "NetVersion", -} - func (c *eTHBACKENDClient) NetVersion(ctx context.Context, in *NetVersionRequest, opts ...grpc.CallOption) (*NetVersionReply, error) { out := new(NetVersionReply) err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/NetVersion", in, out, opts...) @@ -70,10 +58,6 @@ func (c *eTHBACKENDClient) NetVersion(ctx context.Context, in *NetVersionRequest return out, nil } -var eTHBACKENDBloomStatusStreamDesc = &grpc.StreamDesc{ - StreamName: "BloomStatus", -} - func (c *eTHBACKENDClient) BloomStatus(ctx context.Context, in *BloomStatusRequest, opts ...grpc.CallOption) (*BloomStatusReply, error) { out := new(BloomStatusReply) err := c.cc.Invoke(ctx, "/remote.ETHBACKEND/BloomStatus", in, out, opts...) @@ -83,174 +67,132 @@ func (c *eTHBACKENDClient) BloomStatus(ctx context.Context, in *BloomStatusReque return out, nil } -// ETHBACKENDService is the service API for ETHBACKEND service. -// Fields should be assigned to their respective handler implementations only before -// RegisterETHBACKENDService is called. Any unassigned fields will result in the -// handler for that method returning an Unimplemented error. -type ETHBACKENDService struct { - Add func(context.Context, *TxRequest) (*AddReply, error) - Etherbase func(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) - NetVersion func(context.Context, *NetVersionRequest) (*NetVersionReply, error) - BloomStatus func(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) +// ETHBACKENDServer is the server API for ETHBACKEND service. +// All implementations must embed UnimplementedETHBACKENDServer +// for forward compatibility +type ETHBACKENDServer interface { + Add(context.Context, *TxRequest) (*AddReply, error) + Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) + NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) + BloomStatus(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) + mustEmbedUnimplementedETHBACKENDServer() } -func (s *ETHBACKENDService) add(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +// UnimplementedETHBACKENDServer must be embedded to have forward compatible implementations. +type UnimplementedETHBACKENDServer struct { +} + +func (*UnimplementedETHBACKENDServer) Add(context.Context, *TxRequest) (*AddReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") +} +func (*UnimplementedETHBACKENDServer) Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Etherbase not implemented") +} +func (*UnimplementedETHBACKENDServer) NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method NetVersion not implemented") +} +func (*UnimplementedETHBACKENDServer) BloomStatus(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BloomStatus not implemented") +} +func (*UnimplementedETHBACKENDServer) mustEmbedUnimplementedETHBACKENDServer() {} + +func RegisterETHBACKENDServer(s *grpc.Server, srv ETHBACKENDServer) { + s.RegisterService(&_ETHBACKEND_serviceDesc, srv) +} + +func _ETHBACKEND_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.Add(ctx, in) + return srv.(ETHBACKENDServer).Add(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/remote.ETHBACKEND/Add", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.Add(ctx, req.(*TxRequest)) + return srv.(ETHBACKENDServer).Add(ctx, req.(*TxRequest)) } return interceptor(ctx, in, info, handler) } -func (s *ETHBACKENDService) etherbase(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _ETHBACKEND_Etherbase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EtherbaseRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.Etherbase(ctx, in) + return srv.(ETHBACKENDServer).Etherbase(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/remote.ETHBACKEND/Etherbase", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.Etherbase(ctx, req.(*EtherbaseRequest)) + return srv.(ETHBACKENDServer).Etherbase(ctx, req.(*EtherbaseRequest)) } return interceptor(ctx, in, info, handler) } -func (s *ETHBACKENDService) netVersion(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _ETHBACKEND_NetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(NetVersionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.NetVersion(ctx, in) + return srv.(ETHBACKENDServer).NetVersion(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/remote.ETHBACKEND/NetVersion", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.NetVersion(ctx, req.(*NetVersionRequest)) + return srv.(ETHBACKENDServer).NetVersion(ctx, req.(*NetVersionRequest)) } return interceptor(ctx, in, info, handler) } -func (s *ETHBACKENDService) bloomStatus(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _ETHBACKEND_BloomStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BloomStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.BloomStatus(ctx, in) + return srv.(ETHBACKENDServer).BloomStatus(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/remote.ETHBACKEND/BloomStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.BloomStatus(ctx, req.(*BloomStatusRequest)) + return srv.(ETHBACKENDServer).BloomStatus(ctx, req.(*BloomStatusRequest)) } return interceptor(ctx, in, info, handler) } -// RegisterETHBACKENDService registers a service implementation with a gRPC server. -func RegisterETHBACKENDService(s grpc.ServiceRegistrar, srv *ETHBACKENDService) { - srvCopy := *srv - if srvCopy.Add == nil { - srvCopy.Add = func(context.Context, *TxRequest) (*AddReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") - } - } - if srvCopy.Etherbase == nil { - srvCopy.Etherbase = func(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Etherbase not implemented") - } - } - if srvCopy.NetVersion == nil { - srvCopy.NetVersion = func(context.Context, *NetVersionRequest) (*NetVersionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method NetVersion not implemented") - } - } - if srvCopy.BloomStatus == nil { - srvCopy.BloomStatus = func(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method BloomStatus not implemented") - } - } - sd := grpc.ServiceDesc{ - ServiceName: "remote.ETHBACKEND", - Methods: []grpc.MethodDesc{ - { - MethodName: "Add", - Handler: srvCopy.add, - }, - { - MethodName: "Etherbase", - Handler: srvCopy.etherbase, - }, - { - MethodName: "NetVersion", - Handler: srvCopy.netVersion, - }, - { - MethodName: "BloomStatus", - Handler: srvCopy.bloomStatus, - }, +var _ETHBACKEND_serviceDesc = grpc.ServiceDesc{ + ServiceName: "remote.ETHBACKEND", + HandlerType: (*ETHBACKENDServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Add", + Handler: _ETHBACKEND_Add_Handler, }, - Streams: []grpc.StreamDesc{}, - Metadata: "remote/ethbackend.proto", - } - - s.RegisterService(&sd, nil) -} - -// NewETHBACKENDService creates a new ETHBACKENDService containing the -// implemented methods of the ETHBACKEND service in s. Any unimplemented -// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. -// This includes situations where the method handler is misspelled or has the wrong -// signature. For this reason, this function should be used with great care and -// is not recommended to be used by most users. -func NewETHBACKENDService(s interface{}) *ETHBACKENDService { - ns := ÐBACKENDService{} - if h, ok := s.(interface { - Add(context.Context, *TxRequest) (*AddReply, error) - }); ok { - ns.Add = h.Add - } - if h, ok := s.(interface { - Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) - }); ok { - ns.Etherbase = h.Etherbase - } - if h, ok := s.(interface { - NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) - }); ok { - ns.NetVersion = h.NetVersion - } - if h, ok := s.(interface { - BloomStatus(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) - }); ok { - ns.BloomStatus = h.BloomStatus - } - return ns -} - -// UnstableETHBACKENDService is the service API for ETHBACKEND service. -// New methods may be added to this interface if they are added to the service -// definition, which is not a backward-compatible change. For this reason, -// use of this type is not recommended. -type UnstableETHBACKENDService interface { - Add(context.Context, *TxRequest) (*AddReply, error) - Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) - NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) - BloomStatus(context.Context, *BloomStatusRequest) (*BloomStatusReply, error) + { + MethodName: "Etherbase", + Handler: _ETHBACKEND_Etherbase_Handler, + }, + { + MethodName: "NetVersion", + Handler: _ETHBACKEND_NetVersion_Handler, + }, + { + MethodName: "BloomStatus", + Handler: _ETHBACKEND_BloomStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "remote/ethbackend.proto", } diff --git a/ethdb/remote/kv.pb.go b/ethdb/remote/kv.pb.go index df1389eab7e..d64f3299b3d 100644 --- a/ethdb/remote/kv.pb.go +++ b/ethdb/remote/kv.pb.go @@ -1,207 +1,326 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: remote/kv.proto package remote import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type SeekRequest struct { - BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` - SeekKey []byte `protobuf:"bytes,2,opt,name=seekKey,proto3" json:"seekKey,omitempty"` - Prefix []byte `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - StartSreaming bool `protobuf:"varint,4,opt,name=startSreaming,proto3" json:"startSreaming,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekRequest) Reset() { *m = SeekRequest{} } -func (m *SeekRequest) String() string { return proto.CompactTextString(m) } -func (*SeekRequest) ProtoMessage() {} -func (*SeekRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_007925a9984cab2c, []int{0} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *SeekRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekRequest.Unmarshal(m, b) + BucketName string `protobuf:"bytes,1,opt,name=bucketName,proto3" json:"bucketName,omitempty"` + SeekKey []byte `protobuf:"bytes,2,opt,name=seekKey,proto3" json:"seekKey,omitempty"` // streaming start from this key + Prefix []byte `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` // streaming stops when see first key without given prefix + StartSreaming bool `protobuf:"varint,4,opt,name=startSreaming,proto3" json:"startSreaming,omitempty"` } -func (m *SeekRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekRequest.Marshal(b, m, deterministic) -} -func (m *SeekRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekRequest.Merge(m, src) + +func (x *SeekRequest) Reset() { + *x = SeekRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_kv_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SeekRequest) XXX_Size() int { - return xxx_messageInfo_SeekRequest.Size(m) + +func (x *SeekRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SeekRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SeekRequest.DiscardUnknown(m) + +func (*SeekRequest) ProtoMessage() {} + +func (x *SeekRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_kv_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SeekRequest proto.InternalMessageInfo +// Deprecated: Use SeekRequest.ProtoReflect.Descriptor instead. +func (*SeekRequest) Descriptor() ([]byte, []int) { + return file_remote_kv_proto_rawDescGZIP(), []int{0} +} -func (m *SeekRequest) GetBucketName() string { - if m != nil { - return m.BucketName +func (x *SeekRequest) GetBucketName() string { + if x != nil { + return x.BucketName } return "" } -func (m *SeekRequest) GetSeekKey() []byte { - if m != nil { - return m.SeekKey +func (x *SeekRequest) GetSeekKey() []byte { + if x != nil { + return x.SeekKey } return nil } -func (m *SeekRequest) GetPrefix() []byte { - if m != nil { - return m.Prefix +func (x *SeekRequest) GetPrefix() []byte { + if x != nil { + return x.Prefix } return nil } -func (m *SeekRequest) GetStartSreaming() bool { - if m != nil { - return m.StartSreaming +func (x *SeekRequest) GetStartSreaming() bool { + if x != nil { + return x.StartSreaming } return false } type Pair struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Pair) Reset() { *m = Pair{} } -func (m *Pair) String() string { return proto.CompactTextString(m) } -func (*Pair) ProtoMessage() {} -func (*Pair) Descriptor() ([]byte, []int) { - return fileDescriptor_007925a9984cab2c, []int{1} + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *Pair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Pair.Unmarshal(m, b) -} -func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Pair.Marshal(b, m, deterministic) -} -func (m *Pair) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pair.Merge(m, src) +func (x *Pair) Reset() { + *x = Pair{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_kv_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Pair) XXX_Size() int { - return xxx_messageInfo_Pair.Size(m) + +func (x *Pair) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Pair) XXX_DiscardUnknown() { - xxx_messageInfo_Pair.DiscardUnknown(m) + +func (*Pair) ProtoMessage() {} + +func (x *Pair) ProtoReflect() protoreflect.Message { + mi := &file_remote_kv_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Pair proto.InternalMessageInfo +// Deprecated: Use Pair.ProtoReflect.Descriptor instead. +func (*Pair) Descriptor() ([]byte, []int) { + return file_remote_kv_proto_rawDescGZIP(), []int{1} +} -func (m *Pair) GetKey() []byte { - if m != nil { - return m.Key +func (x *Pair) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *Pair) GetValue() []byte { - if m != nil { - return m.Value +func (x *Pair) GetValue() []byte { + if x != nil { + return x.Value } return nil } type PairKey struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - VSize uint64 `protobuf:"varint,2,opt,name=vSize,proto3" json:"vSize,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PairKey) Reset() { *m = PairKey{} } -func (m *PairKey) String() string { return proto.CompactTextString(m) } -func (*PairKey) ProtoMessage() {} -func (*PairKey) Descriptor() ([]byte, []int) { - return fileDescriptor_007925a9984cab2c, []int{2} + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + VSize uint64 `protobuf:"varint,2,opt,name=vSize,proto3" json:"vSize,omitempty"` } -func (m *PairKey) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PairKey.Unmarshal(m, b) -} -func (m *PairKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PairKey.Marshal(b, m, deterministic) -} -func (m *PairKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PairKey.Merge(m, src) +func (x *PairKey) Reset() { + *x = PairKey{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_kv_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PairKey) XXX_Size() int { - return xxx_messageInfo_PairKey.Size(m) + +func (x *PairKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PairKey) XXX_DiscardUnknown() { - xxx_messageInfo_PairKey.DiscardUnknown(m) + +func (*PairKey) ProtoMessage() {} + +func (x *PairKey) ProtoReflect() protoreflect.Message { + mi := &file_remote_kv_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PairKey proto.InternalMessageInfo +// Deprecated: Use PairKey.ProtoReflect.Descriptor instead. +func (*PairKey) Descriptor() ([]byte, []int) { + return file_remote_kv_proto_rawDescGZIP(), []int{2} +} -func (m *PairKey) GetKey() []byte { - if m != nil { - return m.Key +func (x *PairKey) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *PairKey) GetVSize() uint64 { - if m != nil { - return m.VSize +func (x *PairKey) GetVSize() uint64 { + if x != nil { + return x.VSize } return 0 } -func init() { - proto.RegisterType((*SeekRequest)(nil), "remote.SeekRequest") - proto.RegisterType((*Pair)(nil), "remote.Pair") - proto.RegisterType((*PairKey)(nil), "remote.PairKey") -} - -func init() { proto.RegisterFile("remote/kv.proto", fileDescriptor_007925a9984cab2c) } - -var fileDescriptor_007925a9984cab2c = []byte{ - // 264 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4b, 0xfb, 0x30, - 0x14, 0xc7, 0x49, 0xd7, 0x5f, 0xf7, 0xf3, 0x59, 0xd9, 0x88, 0x22, 0xc1, 0x83, 0x94, 0xe2, 0xa1, - 0x1e, 0x96, 0xa9, 0x3b, 0x7a, 0xdb, 0xb5, 0x20, 0x23, 0x85, 0x1d, 0xbc, 0xa5, 0xfa, 0x9c, 0x21, - 0xd6, 0xcc, 0x34, 0x1d, 0xce, 0xbb, 0xff, 0xb7, 0xa4, 0xd9, 0x60, 0x82, 0xa7, 0xe4, 0xf3, 0xc9, - 0x7b, 0xf9, 0xf2, 0x1e, 0x8c, 0x2c, 0x36, 0xc6, 0xe1, 0x54, 0x6f, 0xf8, 0xda, 0x1a, 0x67, 0x68, - 0x12, 0x44, 0xfe, 0x4d, 0xe0, 0xb8, 0x42, 0xd4, 0x02, 0x3f, 0x3a, 0x6c, 0x1d, 0xbd, 0x04, 0xa8, - 0xbb, 0x27, 0x8d, 0xee, 0x41, 0x36, 0xc8, 0x48, 0x46, 0x8a, 0x23, 0x71, 0x60, 0x28, 0x83, 0x61, - 0x8b, 0xa8, 0x4b, 0xdc, 0xb2, 0x28, 0x23, 0x45, 0x2a, 0xf6, 0x48, 0xcf, 0x21, 0x59, 0x5b, 0x7c, - 0x51, 0x9f, 0x6c, 0xd0, 0x3f, 0xec, 0x88, 0x5e, 0xc1, 0x49, 0xeb, 0xa4, 0x75, 0x95, 0x45, 0xd9, - 0xa8, 0xf7, 0x15, 0x8b, 0x33, 0x52, 0xfc, 0x17, 0xbf, 0x65, 0xce, 0x21, 0x5e, 0x48, 0x65, 0xe9, - 0x18, 0x06, 0x1a, 0xb7, 0x7d, 0x70, 0x2a, 0xfc, 0x95, 0x9e, 0xc1, 0xbf, 0x8d, 0x7c, 0xeb, 0x70, - 0x97, 0x17, 0x20, 0xbf, 0x85, 0xa1, 0xaf, 0xf7, 0xc1, 0x7f, 0xb7, 0x54, 0xea, 0x2b, 0xb4, 0xc4, - 0x22, 0xc0, 0xdd, 0x0c, 0xa2, 0x72, 0x49, 0x27, 0x10, 0xfb, 0x79, 0xe9, 0x29, 0x0f, 0x1b, 0xe0, - 0x07, 0xd3, 0x5f, 0xa4, 0x7b, 0xe9, 0xff, 0x2e, 0xc8, 0x0d, 0x99, 0x5f, 0xc3, 0x58, 0x19, 0xee, - 0x3a, 0x5b, 0x9b, 0xc9, 0x0a, 0xdd, 0x2b, 0x7f, 0xae, 0xe7, 0x51, 0xb9, 0x5c, 0x90, 0xc7, 0x11, - 0x9f, 0x86, 0xe2, 0xfb, 0x70, 0xd4, 0x49, 0xbf, 0xd9, 0xd9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xda, 0x4b, 0xb4, 0x66, 0x6c, 0x01, 0x00, 0x00, +var File_remote_kv_proto protoreflect.FileDescriptor + +var file_remote_kv_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x6b, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x0b, 0x53, 0x65, + 0x65, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x65, + 0x6b, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x65, 0x65, 0x6b, + 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x53, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, + 0x67, 0x22, 0x2e, 0x0a, 0x04, 0x50, 0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x31, 0x0a, 0x07, 0x50, 0x61, 0x69, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, + 0x53, 0x69, 0x7a, 0x65, 0x32, 0x33, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x2d, 0x0a, 0x04, 0x53, 0x65, + 0x65, 0x6b, 0x12, 0x13, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x65, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x2e, 0x50, 0x61, 0x69, 0x72, 0x28, 0x01, 0x30, 0x01, 0x42, 0x29, 0x0a, 0x10, 0x69, 0x6f, 0x2e, + 0x74, 0x75, 0x72, 0x62, 0x6f, 0x2d, 0x67, 0x65, 0x74, 0x68, 0x2e, 0x64, 0x62, 0x42, 0x02, 0x4b, + 0x56, 0x50, 0x01, 0x5a, 0x0f, 0x2e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_remote_kv_proto_rawDescOnce sync.Once + file_remote_kv_proto_rawDescData = file_remote_kv_proto_rawDesc +) + +func file_remote_kv_proto_rawDescGZIP() []byte { + file_remote_kv_proto_rawDescOnce.Do(func() { + file_remote_kv_proto_rawDescData = protoimpl.X.CompressGZIP(file_remote_kv_proto_rawDescData) + }) + return file_remote_kv_proto_rawDescData +} + +var file_remote_kv_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_remote_kv_proto_goTypes = []interface{}{ + (*SeekRequest)(nil), // 0: remote.SeekRequest + (*Pair)(nil), // 1: remote.Pair + (*PairKey)(nil), // 2: remote.PairKey +} +var file_remote_kv_proto_depIdxs = []int32{ + 0, // 0: remote.KV.Seek:input_type -> remote.SeekRequest + 1, // 1: remote.KV.Seek:output_type -> remote.Pair + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_remote_kv_proto_init() } +func file_remote_kv_proto_init() { + if File_remote_kv_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_remote_kv_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_kv_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_kv_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PairKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_remote_kv_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_remote_kv_proto_goTypes, + DependencyIndexes: file_remote_kv_proto_depIdxs, + MessageInfos: file_remote_kv_proto_msgTypes, + }.Build() + File_remote_kv_proto = out.File + file_remote_kv_proto_rawDesc = nil + file_remote_kv_proto_goTypes = nil + file_remote_kv_proto_depIdxs = nil } diff --git a/ethdb/remote/kv_grpc.pb.go b/ethdb/remote/kv_grpc.pb.go index 354e001ab2d..0dcdfe24f50 100644 --- a/ethdb/remote/kv_grpc.pb.go +++ b/ethdb/remote/kv_grpc.pb.go @@ -11,7 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion7 +const _ = grpc.SupportPackageIsVersion6 // KVClient is the client API for KV service. // @@ -32,14 +32,8 @@ func NewKVClient(cc grpc.ClientConnInterface) KVClient { return &kVClient{cc} } -var kVSeekStreamDesc = &grpc.StreamDesc{ - StreamName: "Seek", - ServerStreams: true, - ClientStreams: true, -} - func (c *kVClient) Seek(ctx context.Context, opts ...grpc.CallOption) (KV_SeekClient, error) { - stream, err := c.cc.NewStream(ctx, kVSeekStreamDesc, "/remote.KV/Seek", opts...) + stream, err := c.cc.NewStream(ctx, &_KV_serviceDesc.Streams[0], "/remote.KV/Seek", opts...) if err != nil { return nil, err } @@ -69,20 +63,33 @@ func (x *kVSeekClient) Recv() (*Pair, error) { return m, nil } -// KVService is the service API for KV service. -// Fields should be assigned to their respective handler implementations only before -// RegisterKVService is called. Any unassigned fields will result in the -// handler for that method returning an Unimplemented error. -type KVService struct { +// KVServer is the server API for KV service. +// All implementations must embed UnimplementedKVServer +// for forward compatibility +type KVServer interface { // open a cursor on given position of given bucket // if streaming requested - streams all data: stops if client's buffer is full, resumes when client read enough from buffer // if streaming not requested - streams next data only when clients sends message to bi-directional channel // no full consistency guarantee - server implementation can close/open underlying db transaction at any time - Seek func(KV_SeekServer) error + Seek(KV_SeekServer) error + mustEmbedUnimplementedKVServer() } -func (s *KVService) seek(_ interface{}, stream grpc.ServerStream) error { - return s.Seek(&kVSeekServer{stream}) +// UnimplementedKVServer must be embedded to have forward compatible implementations. +type UnimplementedKVServer struct { +} + +func (*UnimplementedKVServer) Seek(KV_SeekServer) error { + return status.Errorf(codes.Unimplemented, "method Seek not implemented") +} +func (*UnimplementedKVServer) mustEmbedUnimplementedKVServer() {} + +func RegisterKVServer(s *grpc.Server, srv KVServer) { + s.RegisterService(&_KV_serviceDesc, srv) +} + +func _KV_Seek_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVServer).Seek(&kVSeekServer{stream}) } type KV_SeekServer interface { @@ -107,53 +114,17 @@ func (x *kVSeekServer) Recv() (*SeekRequest, error) { return m, nil } -// RegisterKVService registers a service implementation with a gRPC server. -func RegisterKVService(s grpc.ServiceRegistrar, srv *KVService) { - srvCopy := *srv - if srvCopy.Seek == nil { - srvCopy.Seek = func(KV_SeekServer) error { - return status.Errorf(codes.Unimplemented, "method Seek not implemented") - } - } - sd := grpc.ServiceDesc{ - ServiceName: "remote.KV", - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Seek", - Handler: srvCopy.seek, - ServerStreams: true, - ClientStreams: true, - }, +var _KV_serviceDesc = grpc.ServiceDesc{ + ServiceName: "remote.KV", + HandlerType: (*KVServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Seek", + Handler: _KV_Seek_Handler, + ServerStreams: true, + ClientStreams: true, }, - Metadata: "remote/kv.proto", - } - - s.RegisterService(&sd, nil) -} - -// NewKVService creates a new KVService containing the -// implemented methods of the KV service in s. Any unimplemented -// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. -// This includes situations where the method handler is misspelled or has the wrong -// signature. For this reason, this function should be used with great care and -// is not recommended to be used by most users. -func NewKVService(s interface{}) *KVService { - ns := &KVService{} - if h, ok := s.(interface{ Seek(KV_SeekServer) error }); ok { - ns.Seek = h.Seek - } - return ns -} - -// UnstableKVService is the service API for KV service. -// New methods may be added to this interface if they are added to the service -// definition, which is not a backward-compatible change. For this reason, -// use of this type is not recommended. -type UnstableKVService interface { - // open a cursor on given position of given bucket - // if streaming requested - streams all data: stops if client's buffer is full, resumes when client read enough from buffer - // if streaming not requested - streams next data only when clients sends message to bi-directional channel - // no full consistency guarantee - server implementation can close/open underlying db transaction at any time - Seek(KV_SeekServer) error + }, + Metadata: "remote/kv.proto", } From 186d77eddd7455d855cd6a0f5378a0ff890b090e Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 3 Sep 2020 13:40:28 +0700 Subject: [PATCH 18/21] switch back to master constructor --- ethdb/remote/remotedbserver/db.go | 2 +- ethdb/remote/remotedbserver/ethbackend.go | 2 +- ethdb/remote/remotedbserver/server.go | 29 ++++++----------------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ethdb/remote/remotedbserver/db.go b/ethdb/remote/remotedbserver/db.go index 8c2417b71fa..0a54c074993 100644 --- a/ethdb/remote/remotedbserver/db.go +++ b/ethdb/remote/remotedbserver/db.go @@ -8,7 +8,7 @@ import ( ) type DBServer struct { - remote.UnstableDBService // must be embedded to have forward compatible implementations. + remote.UnimplementedDBServer // must be embedded to have forward compatible implementations. kv ethdb.KV } diff --git a/ethdb/remote/remotedbserver/ethbackend.go b/ethdb/remote/remotedbserver/ethbackend.go index 93ecc868389..9eb0e391de1 100644 --- a/ethdb/remote/remotedbserver/ethbackend.go +++ b/ethdb/remote/remotedbserver/ethbackend.go @@ -12,7 +12,7 @@ import ( ) type EthBackendServer struct { - remote.UnstableETHBACKENDService // must be embedded to have forward compatible implementations. + remote.UnimplementedETHBACKENDServer // must be embedded to have forward compatible implementations. eth core.Backend } diff --git a/ethdb/remote/remotedbserver/server.go b/ethdb/remote/remotedbserver/server.go index 8e74cd487d7..c7ab0f4f828 100644 --- a/ethdb/remote/remotedbserver/server.go +++ b/ethdb/remote/remotedbserver/server.go @@ -22,7 +22,7 @@ import ( const MaxTxTTL = time.Minute type KvServer struct { - remote.UnstableKVService // must be embedded to have forward compatible implementations. + remote.UnimplementedKVServer // must be embedded to have forward compatible implementations. kv ethdb.KV } @@ -35,24 +35,9 @@ func StartGrpc(kv ethdb.KV, eth core.Backend, addr string) { return } - kvServer := NewKvServer(kv) - kvSrv := &remote.KVService{ - Seek: kvServer.Seek, - } - - dbServer := NewDBServer(kv) - dbSrv := &remote.DBService{ - Size: dbServer.Size, - BucketSize: dbServer.BucketSize, - } - - ethServer := NewEthBackendServer(eth) - ethBackendSrv := &remote.ETHBACKENDService{ - Add: ethServer.Add, - Etherbase: ethServer.Etherbase, - NetVersion: ethServer.NetVersion, - BloomStatus: ethServer.BloomStatus, - } + kvSrv := NewKvServer(kv) + dbSrv := NewDBServer(kv) + ethBackendSrv := NewEthBackendServer(eth) var ( streamInterceptors []grpc.StreamServerInterceptor unaryInterceptors []grpc.UnaryServerInterceptor @@ -72,9 +57,9 @@ func StartGrpc(kv ethdb.KV, eth core.Backend, addr string) { grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(streamInterceptors...)), grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unaryInterceptors...)), ) - remote.RegisterKVService(grpcServer, kvSrv) - remote.RegisterDBService(grpcServer, dbSrv) - remote.RegisterETHBACKENDService(grpcServer, ethBackendSrv) + remote.RegisterKVServer(grpcServer, kvSrv) + remote.RegisterDBServer(grpcServer, dbSrv) + remote.RegisterETHBACKENDServer(grpcServer, ethBackendSrv) if metrics.Enabled { grpc_prometheus.Register(grpcServer) From 3d42ec92d8da5233e24a2e66eb85b5614ec87eeb Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 3 Sep 2020 13:42:25 +0700 Subject: [PATCH 19/21] switch back to master constructor --- ethdb/kv_abstract_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ethdb/kv_abstract_test.go b/ethdb/kv_abstract_test.go index 9fc7c517df6..eebdd3ab458 100644 --- a/ethdb/kv_abstract_test.go +++ b/ethdb/kv_abstract_test.go @@ -108,12 +108,7 @@ func setupDatabases(f ethdb.BucketConfigsFunc) (writeDBs []ethdb.KV, readDBs []e grpcServer := grpc.NewServer() go func() { - kvSrv := remotedbserver.NewKvServer(writeDBs[2]) - kvService := &remote.KVService{ - Seek: kvSrv.Seek, - } - - remote.RegisterKVService(grpcServer, kvService) + remote.RegisterKVServer(grpcServer, remotedbserver.NewKvServer(writeDBs[2])) if err := grpcServer.Serve(conn); err != nil { log.Error("private RPC server fail", "err", err) } From 94b915c4bcfb562f618d5d4a54affd240ed7d4ae Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 3 Sep 2020 14:07:43 +0700 Subject: [PATCH 20/21] add a bit docs --- Makefile | 8 +++++--- cmd/rpcdaemon/Readme.md | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3086b96cc80..0369d7217de 100644 --- a/Makefile +++ b/Makefile @@ -125,12 +125,9 @@ clean: # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'. devtools: - # See: ./cmd/hack/binary-deps/main.go env GOBIN= go install golang.org/x/tools/cmd/stringer env GOBIN= go install github.com/kevinburke/go-bindata/go-bindata env GOBIN= go install github.com/fjl/gencodec - env GOBIN= go install google.golang.org/protobuf/cmd/protoc-gen-go # generates proto messages - env GOBIN= go install google.golang.org/grpc/cmd/protoc-gen-go-grpc # generates grpc services env GOBIN= go install ./cmd/abigen @type "npm" 2> /dev/null || echo 'Please install node.js and npm' @type "solc" 2> /dev/null || echo 'Please install solc' @@ -140,6 +137,11 @@ bindings: go generate ./tests/contracts/ go generate ./cmd/tester/contracts/ go generate ./core/state/contracts/ + +grpc: + # See also: ./cmd/hack/binary-deps/main.go + env GOBIN= go install google.golang.org/protobuf/cmd/protoc-gen-go # generates proto messages + env GOBIN= go install google.golang.org/grpc/cmd/protoc-gen-go-grpc # generates grpc services go generate ./ethdb simulator-genesis: diff --git a/cmd/rpcdaemon/Readme.md b/cmd/rpcdaemon/Readme.md index 5487524010b..a8ed949a7eb 100644 --- a/cmd/rpcdaemon/Readme.md +++ b/cmd/rpcdaemon/Readme.md @@ -33,3 +33,7 @@ It should return something like this (depending on how far your turbo-geth node ```` {"jsonrpc":"2.0","id":1,"result":823909} ```` + +### For Developers + +**Code generation**: `go.mod` stores right version of generators, use `mage grpc` to install it and generate code. \ No newline at end of file From 1c0384522762c28392630cc345453b0229d6c917 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 3 Sep 2020 14:15:41 +0700 Subject: [PATCH 21/21] add a bit docs --- cmd/rpcdaemon/Readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/rpcdaemon/Readme.md b/cmd/rpcdaemon/Readme.md index a8ed949a7eb..6d3c6976fdf 100644 --- a/cmd/rpcdaemon/Readme.md +++ b/cmd/rpcdaemon/Readme.md @@ -36,4 +36,6 @@ It should return something like this (depending on how far your turbo-geth node ### For Developers -**Code generation**: `go.mod` stores right version of generators, use `mage grpc` to install it and generate code. \ No newline at end of file +**Code generation**: `go.mod` stores right version of generators, use `mage grpc` to install it and generate code. + +`protoc` version not managed but recommended version is 3.*, [install instruction](https://grpc.io/docs/protoc-installation/) \ No newline at end of file