Proto commits in vmware/concord-bft

These 65 commits are when the Protocol Buffers files have changed:

Commit:66ec8d0
Author:Mahaveer Darade
Committer:GitHub

Introduce generic header to accomodate Eth and Non-Eth blocks (#2986) 1. Generic header would be added at V4 block adder layer to bring uniformity in block structure. 2. Block, Transactions and other relevant definitions would be moved from proto to CMF format. Co-authored-by: Mahaveer Darade <mdarade@vmware.com>

Commit:6b7bf17
Author:Mahaveer Darade
Committer:cloudnoize

Remove redundant proto file containing block and transaction (#2952) Athena also has this redundant proto file. All the relevant components would be referring to types defined in this single proto file. Co-authored-by: Mahaveer Darade <mdarade@vmware.com>

Commit:27d0b0b
Author:mgrychow
Committer:GitHub

Application specific data storage in privacy wallet service (#2977) * protobuf messages for application data * methods to set and get generic application data in FileBasedUserStorage for privacy service * align TestUTTClientApi * make FileBasedUserStorage a member of PrivacyWalletServiceImpl * add set/get app data request/response to PrivacyWallet protobuf messages * implementation of SetAppData and GetAppData messages handling in privacy service * unit test for getting not set app data value from privacy service * make set/get app data fields repeated * change field ordering in PrivacyWalletRequest proto message * remove duplicated test after rebase

The documentation is generated from this commit.

Commit:4fe8dc5
Author:Nikolay Georgiev
Committer:GitHub

Add signature field to response proto object (#2963)

Commit:d17685d
Author:harsht1737
Committer:GitHub

Clientservice and replica handling for primary-only logic for Filter APIs (#2955)

Commit:699a9bf
Author:rachit chadha
Committer:rachit chadha

send filter api request to the first validator node id

Commit:8c94cd4
Author:Yehonatan Buchnik
Committer:GitHub

Wallet service fixes (#2951) * move user implementation to store coins in map instead of a vector * Add ability to get a map of nullifier->value for existing normal coins

Commit:9ceee52
Author:mgrychow
Committer:GitHub

add user_id parameter in GetStateResponse of PrivacyService (#2946)

Commit:029c1dd
Author:Yehonatan Buchnik
Committer:GitHub

privacy wallet service flows (mint, budget, transfer, and burn) (#2929) * last executed sequence number is an application/wallet abstraction. This commit is to remove this notion from the User module * Implement mint, burn, transact, and claimCoins flows * Unitests for budget and mint * remove userPKI header file * Add unitests for privacy service flows * Remove streaming for stated transactions * Add getState request * fix proto file * fix proto file * fix proto file * Add number of output coins * catch exception to figure out error precisely, add debug logs around for development, cleanit up later * Address reviews * Address reviews * Fix tidy checks --------- Co-authored-by: Senthil Balakrishnan <balakrishnas@vmware.com>

Commit:52c56cb
Author:Yehonatan Buchnik
Committer:GitHub

Wallet-service - configure & registration flows (#2924) In this PR we present two flows for the wallet service configure - initiate the wallet with the utt public configuration register - register a user. This flow is combined of two sub-flows: (a) get registration input, and (b) update registration s2 and signature In addition, some functionality regarding certificates and crypto was added, in order to complete the full flows in the frontend

Commit:62fb279
Author:Senthil Balakrishnan

break files to granular level. The next push would comprise of collecting all common wallet code into a library

Commit:1b91ffb
Author:Senthil Balakrishnan

draft make

Commit:96a6fe2
Author:ssitu
Committer:ssitu

Moving execution service api to open source

Commit:cadad70
Author:Yehonatan Buchnik
Committer:GitHub

Privacy feature (#2859) * extend replica api to return some necessry objects needed for utt * Add INTERNAL_FLAG to message's flags * Add INTERNAL_FLAG to message's flags * Fix internal flags issues * fix compilation error * add pragma once * add some necessary libutt api * Fix an error with randomness when creating a coin by the replicas * add an option to create determisitc coin commitment for coins created by replicas * Separate the wallet in its own source file * The wallet now assumes only a single user. The user id is provided as a command line argument * WIP budget, mint, transfer, burn operations * wallet fixes * utt client api user now has more consistent error handling by throwing exceptions instead of returning a bool result. Allow updateMintTx and updateBurnTx to ignore the transaction if the owner is someone else * Add support for mint transactions originating from the wallet * Add number of outputs to utt::Transaction * TestUTTClientApi now relies on the fact that updateBurnTx and updateMintTx ignore mints/burns intended for a different user when synchronizing * Multiplex multiple users in the same wallet for initial testing purposes * Rename wallet command 'info' to 'show' * Add a way to pre-create budget tokens in the sample wallet * Fix creation of budget locally to not happen before registration * Check if the wallet exists when processing commands * Add comment about the workaround dealing with the wallet service not returning complete messages occasionaly when getting tx data * Add public balance to wallet-cli * Refactor wallet cli app to avoid excessive nesting when validating input. Add a simple debug output to inspect the coins of a user * Rework wallet-cli to use a bi-directional stream for all wallet requests * Fix pki was referenced as a local variable. Renaming * Initial split of the privacy-admin-cli application with just the deploy command from utt-wallet-cli * Transform the deploy command into a configure command in the wallet-cli. Instead of generating and deploying a config, the configure command will fetch an already deployed configuration by the admin-cli * Use the public config obtained from the privacy contract * Make wallet-cli single user by providing a user-id as an argument * Add full validation capabilites * Fix a bug where the new api transaction object exposes the input coins * Cleanup admin and wallet cli outputs. Demote some loginfo to logdbg statements in libutt. Fix wallet-cli reading transfer instead of burn response (didn't affect correctness) * Improve the new utt api testing framework, integrating it with gtest and remove old files * Fix clang-tidy checks * Add getter for partial signatures map from the complete signature message * complete rebase * Add debug logs to user in utt-client-api * Add ability to create budget from admin cli * Remove option to create budgets from wallet. This is done now by the admin. Remove requirement to get the full privacy config - this was only needed for temporary creation of budget tokens locally * Move utt new api to pImpl * Simple e2e test binary for utt privacy feature * Add randomness to rcm1 (rcm1 in created by the client, so it's deterministic) * Add public transfer command * Debug logs in e2e test for utt privacy feature * disable NTL_THREADS in libutt * Extract E2eTestSuite class in e2e privacy feature testing * Separate e2e privacy test scenario from test execution env - E2eTestScenario class extracted Co-authored-by: Evgeniy Dzhurov <edzhurov@vmware.com> Co-authored-by: cloudnoize <elerer@vmware.com> Co-authored-by: Maciej Grychowski <maciej.grychowski@onet.eu>

Commit:e9acc93
Author:cloudnoize
Committer:Yehonatan Buchnik

Add public transfer command

Commit:df9802e
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Remove option to create budgets from wallet. This is done now by the admin. Remove requirement to get the full privacy config - this was only needed for temporary creation of budget tokens locally

Commit:2bf38a7
Author:cloudnoize
Committer:Yehonatan Buchnik

Add ability to create budget from admin cli

Commit:ebd7dda
Author:Maciej Grychowski
Committer:Yehonatan Buchnik

Simple e2e test binary for utt privacy feature

Commit:cf21827
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Transform the deploy command into a configure command in the wallet-cli. Instead of generating and deploying a config, the configure command will fetch an already deployed configuration by the admin-cli

Commit:959791b
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Add public balance to wallet-cli

Commit:34ba927
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Fix creation of budget locally to not happen before registration

Commit:8cde0e6
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Add number of outputs to utt::Transaction

Commit:72eb57e
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Add support for mint transactions originating from the wallet

Commit:de5a3b2
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Rework wallet-cli to use a bi-directional stream for all wallet requests

Commit:7e54843
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

Initial split of the privacy-admin-cli application with just the deploy command from utt-wallet-cli

Commit:56c27ae
Author:Evgeniy Dzhurov
Committer:Yehonatan Buchnik

WIP budget, mint, transfer, burn operations

Commit:d404ba2
Author:shgandhi
Committer:shgandhi

Copy gRPC health.proto to concord-bft This commit adds gRPC health.proto to concord-bft. Since, we don't intend to use the default implementation of gRPC health-check, copying the proto files is required.

Commit:bd38593
Author:Evgeniy Dzhurov
Committer:GitHub

Add support for deployment and registration of users through the sample wallet cli app (#2827) * WIP Sample wallet cli app * WIP wallet cli app * libutt::api curve points can now be de/serialized as byte vectors to be consistent with other data. In this case we need to pass S2 from the server to the client which is a curve point * Fix compilation after rebase onto master * Check if the UTT client api is initialized for each top-level function * Move test keys to a separate source file. Use vector<uint64_t> for s2 since the rest of the system uses this format - it needs to be made consistent with other opaque data types and use vector<uint8_t> eventually. WIP wallet-cli * Add a TestUserPKInfrastructure with a number of pre-generate RSA keys for testing * Remove unrelated changes

Commit:545eef0
Author:Evgeniy Dzhurov
Committer:Evgeniy Dzhurov

Add skeleton of a utt wallet command-line application

Commit:f0d48cc
Author:Evgeniy Dzhurov

Add skeleton of a utt wallet command-line application

Commit:072930b
Author:Evgeniy Dzhurov

Change subproject from wallet-app to wallet-cli. Add primary UTT interface to the wallet grpc api

Commit:f24bb50
Author:Evgeniy Dzhurov

Add a test utt wallet app

Commit:b7c0eb1
Author:Evgeniy Dzhurov

Test utt wallet app using gRPC

Commit:fc077c2
Author:shgandhi
Committer:shgandhi

Correct SubscribeRequest description in event.proto

Commit:e59c337
Author:Celine J Nalkara
Committer:Celine J Nalkara

Added changes to address review comments and standardisation of error messages

Commit:26d5518
Author:Celine J Nalkara
Committer:Celine J Nalkara

Add changes to create concord request to send the application request along with additional data from client.

Commit:1444d6a
Author:Celine J Nalkara
Committer:Celine J Nalkara

Revert "Added changes to fix compatibility issue for modules using raw request/response and typed_request/response" This reverts commit 2231ed4e1c44edf368b907fdf62557687810cc78.

Commit:2231ed4
Author:Celine J Nalkara

Added changes to fix compatibility issue for modules using raw request/response and typed_request/response 1> Rename raw request to old attribute name 2> Removed one of constraint for backward compatibility for referring to raw request type. 3> Replaced changes in code during request and response processing

Commit:eb328ab
Author:Celine J Nalkara
Committer:Celine J Nalkara

Update new Any request in request.proto file to handle both application request type during transition wq# Please enter the commit message for your changes. Lines starting

Commit:b2b8c61
Author:Petar Ivanov
Committer:Petar Ivanov

Add support for block IDs in GetRecentSnapshotResponse Add support for both event group IDs and block IDs when returning the point in the blockchain's history at which the state snapshot was taken. For more details, see the description of the `taken_at` field in StateSnapshotService.GetRecentSnapshotResponse.

Commit:04a4e1b
Author:Petar Ivanov

Add support for block IDs in GetRecentSnapshotResponse Add support for both event group IDs and block IDs when returning the point in the blockchain's history at which the state snapshot was taken. For more details, see the description of the `taken_at` field in StateSnapshotService.GetRecentSnapshotResponse.

Commit:710a101
Author:Petar Ivanov

Add `ledger_time` to `GetRecentSnapshotResponse` The ledger time at which the snapshot was taken.

Commit:bd54f8b
Author:Petar Ivanov

Rename StateSnapshotService to ReplicaStateSnapshotService

Commit:56bb466
Author:robem
Committer:GitHub

Merge pull request #2224 from robem/fix-events-doc Update events.proto doc

Commit:6ffedb0
Author:shgandhi
Committer:shgandhi

Add state_snapshot gRPC interface b/w TRC-TRS This commit add state_snapshot.proto, that defines gRPC interface between TRC and TRS for state streaming.

Commit:587ea49
Author:robem

Update events.proto doc EventGroups start at index 1. Zero is an invalid event group id. This change updates the documentation accordingly.

Commit:cc625a0
Author:Petar Ivanov

Fix naming in the State Snapshot proto file * rename `StateSnapshot` to `StateSnapshotService` in order to conform to service naming conventions * fix a reference to the `last_received_key` field (`from_key` was wrongly used there)

Commit:f6d75e7
Author:Yulia Sherman
Committer:GitHub

Return reply data from the client pool to the client service when operation succeeds (#2204) * Revert "Revert "bft_error_handling: Moving status code to OperationResult"" This reverts commit 5bc1ff4fbc1152dd2a533cb81e766ca61d734c21. * Return reply data from the client pool to the client service when operation succeeds.

Commit:1db6cbc
Author:Petar Ivanov
Committer:Mahaveer Darade

Add FAILED_PRECONDITION as error for StreamSnapshot Rationale is that we might return it if Concord Client cannot verify the state from the replicas (i.e. the signatures don't match). It can be used in different scenarios too.

Commit:8dc13f1
Author:Petar Ivanov

Add FAILED_PRECONDITION as error for StreamSnapshot Rationale is that we might return it if Concord Client cannot verify the state from the replicas (i.e. the signatures don't match). It can be used in different scenarios too.

Commit:f8922ac
Author:Petar Ivanov
Committer:GitHub

Introduce Concord Client's StateSnapshot service (#1950) The `StateSnapshot` service can be used to initialize a client application from a state snapshot visible to Concord Client. Details and explanations are given as comments inside the protobuf file. This interface is the output of work mostly done by @meiersi-da, @andrewjstone and @robem.

Commit:7579f05
Author:robem
Committer:robem

EventGroup: Update tracing This change propagates the trace context from concord to the caller of concord client. Thereby, we leverage the existing legacy interface (bytes) for internal trace context transfer (via thin_replica.proto) but expose it in W3C HTTP header format within a "text map". Note, the functionality has not been end-to-end tested given that we still lack a tracer implementation (such as Jaeger). This will be introduced soon and should uncover any bugs.

Commit:46568cd
Author:robem
Committer:robem

EventService: Event group start at 1 In the protobuf definition, we are stating that the first event group is 0 but in fact it is 1. In addition, we've been setting the "first" last verified state to the requested id and thereby starting at the requested id + 1. The protobuf documentation for the event service clearly states that the subscription request will return updates *starting* at the given ID.

Commit:2802b4d
Author:robem
Committer:robem

Clientservice: Move proto API Given that the API itself is a `vmware.concord.client` API, it should live under the `client` directory. Clientservice simply implements the API but is not in the picture when it comes to its definition.

Commit:1c3c958
Author:robem

Clientservice: Split services in two We have two different gRPC services. The recommendation is to split each of them into their own file and adjust the directory structure so that versioning becomes easier.

Commit:7e20abe
Author:robem

Clientservice: syntax, package, import, option As per Google's recommendation.

Commit:be7e76b
Author:robem
Committer:robem

ConcordClient: Legacy events in proto In order to support the events API that existed before concord client, we introduce Events in concord_client.proto as a possible value to be streamed to the caller. Essentially, events and event groups are different formats on the blockchain and therefore, the caller might retrieve both types. However, we're switching to the latter and hence, once the stream turned to EventGroups it won't go back to Events.

Commit:4580c64
Author:robem
Committer:robem

ThinReplica: Add EventGroups in thin_replica.proto With this PR we're adding EventGroups to the thin replica protocol. EventGroups are documented in concord_client.proto. With this change in place, we can send EventGroups from TRS to the TRC.

Commit:56a7bae
Author:robem
Committer:robem

ConcordClient: Correct subscribe/unsubscribe behavior At the moment, our API is limited to one subscription only. The previous code didn't handle subscribe/unsubscribe properly which lead to various segfaults. This change introduces an exception which is thrown if a subscription is active already.

Commit:148be25
Author:gshruti
Committer:gshruti

Remove key_prefix from thin_replica.proto

Commit:4112b47
Author:robem

ClientService: Document event stream limitation At the moment, the thin replica client only supports a single subscription at a time. Given that concord client will be backed by the TRC this limitation will extend to the gRPC interface. Ofc, this is not intuitive for a gRPC service but we hope to correct this in the future.

Commit:fb65bfb
Author:gshruti
Committer:gshruti

Copy TRS to concord-bft This commit copies TRS files to concord-bft. The purpose of this commit is to provide a reference for the reviewer to review the changes made to the files in question for their move to open-source.

Commit:2a7548a
Author:gshruti
Committer:gshruti

Add concord_kvbc.proto to concord-bft This commit adds concord_storage.proto to kvbc/proto folder in concord-bft undre the name concord_kvbc.proto. The proto file defines a message type `ValueWithTrids` that stores with values with their corresponding ACLs, in this case, TRIDs (thin-replica IDs). On the basis of these TRIDs, values are filtered in kvbc_app_filter.cpp for TRS subscribers.

Commit:9316c6d
Author:gshruti
Committer:gshruti

Add thin_replica.proto to concord-bft

Commit:bf27769
Author:robem
Committer:robem

ConcordClient: Service interface With this change, we publish the future interface for the Concord Client service. In short, Concord Client service is a wrapper around the Concord Client library which includes a pool of bft clients and a subscription mechanism. Concord Client and its components will be introduced and documented in future changes.