Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Hyperledger Iroha v1.0 beta-4 version #1597

Merged
merged 100 commits into from
Aug 2, 2018
Merged

Hyperledger Iroha v1.0 beta-4 version #1597

merged 100 commits into from
Aug 2, 2018

Conversation

neewy
Copy link
Contributor

@neewy neewy commented Jul 25, 2018

In this release following changes were made:

Faster throughput, pluggable state storage

There is less abstraction on state storage level, and validation is done with means of SQL queries. It has significantly improved the performance of Iroha peer and made it less error-prone (#1557).

State storage is plugged over ORM library titled as SOCI, which bundles a nice thread pool for faster interconnection with PostgreSQL; and makes it possible to switch to other supported SQL storage (how about using in-memory SQLite database for even faster throughput? #1505)

Stateful validation errors

All the stateful validation errors are printed in peer logs and response is sent to a client along with transaction status. Now it is a lot easier to check what went wrong with a rejected transaction (#1508)

Important note: this version of Iroha can disclose some personal data like account balance (if a transaction was statefully invalid —account can now get the reason). In the future version we will implement error codes (check them there)

Binary Testing Framework

This is a test framework that helps testing client libraries (now particularly in Python) if they produce valid transactions and queries (if permissions and other business rules were met #1485)

Transaction status streaming over RxCpp

Reactive extensions library in C++ is actively used in our architecture and now is in charge of transaction status processing (#1541)

Input fuzzing

Libfuzz checks the input in our client component (called Torii) and protobuf messages are mutated as well (#1531)

Blocks and proposals are not copied now (and their creation process is benchmarked)

A proposal is a candidate for becoming the next block in Iroha chain. The lifetime of these objects is important, this is why their creation and copying has to be minimized by means of C++ (#1542, #1567)
Creation is benchmarked by means of Google Benchmark library (#1539)

Check the size of signatures set

One of the bugs, that was revealed with help of fuzzing, was a possibly valid empty signature set attached to a transaction. This behavior was fixed in #1536.

API changes

Transaction batch support

Transaction batch is a set of transactions, which are to be applied together. There are two kinds of batches:

  • Ordered batch
    • transactions will be applied strictly in the order they were received
  • Atomic batch
    • the order is still guaranteed
    • failure of any transaction inside it leads to failure of the whole batch

Important note: this feature was not implemented completely in this release, however, interfaces and SDKs have already been changed for easier integration in the future. This does not affect backward compatibility.

Check the status of development here

Amount is passed as a string. Everywhere

Code became much simpler and it is easier to create transactions without SDKs now (#1555)

Proto files were split

Client API proto files now are stored in a shared model folder, whereas as Iroha peer messages are stored in schema folder (#1550)

GetAccountDetail is a bit more powerful now

Check our documentation page

GetPendingTransactions

In order to make scenarios related to transaction batches and multisignature transactions easier Iroha has API endpoint to get transactions of transactions batches which require signing by participating accounts (#1532)

Important note: this feature was not implemented completely in this release, however, interfaces and SDKs have already been changed for easier integration in the future. This does not affect backward compatibility.

Deleted account_id from Add/SubtractAssetQuantity commands

Finally, we have deleted account_id from a previously confusing API in #1511

Roles can have an empty set of permissions

Now users can create empty roles for use cases where such a role can serve a purpose of a tag or the least powerful role in the system (#1510)

Other

Known issues

Windows build does not work at the moment, as well as JS bindings, due to their rough transition to new client libraries

Signed-off-by: Artyom Bakhtin <[email protected]>
@neewy neewy requested review from kamilsa and lebdron July 25, 2018 10:25
@neewy
Copy link
Contributor Author

neewy commented Jul 25, 2018

@lebdron @igor-egorov can we review Codacy issues and decide if we need to put them in backlog?

@l4l l4l added the release label Jul 25, 2018
Akvinikym and others added 3 commits July 25, 2018 19:22
Command validator now has error messages

Signed-off-by: Akvinikym <[email protected]>
- Add IntegrationTestFramework::sendTxAwait
- Reuse AcceptanceFixture primitive in TA test
- Move out primitive methods in fixture
- Fix (and rename accordingly) WithOnlyCanTransferPerm/WithOnlyCanReceivePerm tests
- Rename tx_counter in AcceptanceFixture

Signed-off-by: Kitsu <[email protected]>
Uditha Atukorala and others added 7 commits July 25, 2018 19:38
Signed-off-by: Uditha Atukorala <[email protected]>
* Remove PermissionSet constraints for emptiness
* Add CreateRole permissions validation per element
* Add InvalidCreateRolePermission validator test

Signed-off-by: Kitsu <[email protected]>
@l4l l4l force-pushed the develop branch 2 times, most recently from 6fa98b1 to 57d2f2a Compare July 25, 2018 16:53
tyvision and others added 9 commits July 25, 2018 19:56
Signed-off-by: tyvision <[email protected]>
Stateful error responses are now written to log

Signed-off-by: Akvinikym <[email protected]>
The behavior of createRole command was changed, so the tests had to be updated.

Signed-off-by: Igor Egorov <[email protected]>
* Update proposal and block validators

Signed-off-by: kamilsa <[email protected]>
* Add check for Command variant case
* Add check for Query variant case
* Add related tests

Signed-off-by: Kitsu <[email protected]>
Solonets and others added 2 commits July 25, 2018 20:02
Feature/batch meta #1504

Signed-off-by: Sergei <[email protected]>
Signed-off-by: Igor Egorov <[email protected]>

Before the change it was not possible to build grpc_grpc target
with protobuf installed in a system and without installed grpc.
@neewy
Copy link
Contributor Author

neewy commented Jul 26, 2018

As our CI has issues with dependency updates, we have decided to postpone our release until Jenkins can update build dependencies @bakhtin @kamilsa @lebdron

Docker images push on existing develop branch PR
@bakhtin bakhtin dismissed stale reviews from kamilsa and lebdron via 3e27259 July 26, 2018 16:13
Igor Egorov and others added 5 commits July 27, 2018 09:42
set_pattern could be called simultaneously from several threads affecting global context.
The similar issue - gabime/spdlog#419

Signed-off-by: Igor Egorov <[email protected]>
* fix docker push

Signed-off-by: Artyom Bakhtin <[email protected]>

* handle exception earlier

Signed-off-by: Artyom Bakhtin <[email protected]>

* fix missing property

Signed-off-by: Artyom Bakhtin <[email protected]>
@neewy
Copy link
Contributor Author

neewy commented Jul 28, 2018

Release is blocked with quality gate. Need to review & localize test issues before releasing

nickaleks and others added 3 commits July 29, 2018 21:52
Components where the factory is used:
- ordering service, simulator

Signed-off-by: Nikita Alekseev <[email protected]>
The test (StreamingFullPipelineTest) was failing on slow machines. 
Investigation showed that the root cause was the way thread scheduler works, so the code was generally valid.

Streaming client resubscription is a fully valid use case of streaming service.
The client can resubscribe to the stream if the previous stream was ended unexpectedly for the client.
Unexpectedly means that client requests the hash of a transaction that was definitely sent to Iroha and the stream reaches its end with one of the following statuses: `NOT_RECEIVED`, `STATELESS_VALIDATION_SUCCESS`, `STATEFUL_VALIDATION_SUCCESS`.

Before the fix test client was not able to resubscribe to the stream. Now it can.

```diff
cmake -H. -Bbuild
cd build
make torii_service_test
while test_bin/torii_service_test --gtest_filter=*ull* ; do :; done
+this loop should not be broken up by ASSERT_EQ(last_status, COMMITTED) error message
```

Signed-off-by: Igor Egorov <[email protected]>
* remove observables in getBlocks and getTransaction methods

Signed-off-by: Victor Drobny <[email protected]>
lebdron
lebdron previously approved these changes Jul 30, 2018
* Doxygen docs

Signed-off-by: Alexey R <[email protected]>
Add gdbserver to docker dependencies.
Modify docker security options for remote debugging.

Signed-off-by: Igor Egorov <[email protected]>
muratovv and others added 4 commits July 31, 2018 14:50
* Fix linkage errors:
    add stateless validation target if required
* Rework transactionBatch::calculateReducedBatchHash with template instead of any_range
Add toString method
* Remove unnecessary header

Signed-off-by: Fedor Muratov <[email protected]>
* Fix non-determinism in client test

Non-determinism was introduced by status bus thread.
On slow machines getTxStatus may not return expected status immediately.
Additional read attempt may be required.

Signed-off-by: Igor Egorov <[email protected]>
This will prevent cyclic test case fail when the first run was failed
for some reason.

Signed-off-by: Igor Egorov <[email protected]>
* Fix query validators;
Add descriptions for types
Add missed signed block query validator
Rework transaction and query builder with default signed validator

Signed-off-by: Fedor Muratov <[email protected]>

* Fix typo in validator using name

Signed-off-by: Igor Egorov <[email protected]>

* Make validators naming consistent

Signed-off-by: Igor Egorov <[email protected]>

* Use unsined validators where it is required

Signed-off-by: Igor Egorov <[email protected]>

* add test for query signature

Signed-off-by: Fedor Muratov <[email protected]>

* Add review fixes:
* clean up code
* remove normal case
* add additional check for stateless error

Signed-off-by: Fedor Muratov <[email protected]>
@sorabot
Copy link

sorabot commented Aug 2, 2018

SonarQube analysis reported 19 issues

  • MAJOR 1 major
  • MINOR 18 minor

Top 10 issues

  1. MAJOR query_response_template.hpp#L203: syntax error rule
  2. MINOR interactive_common_cli.cpp#L43: Return value of function to_string() is not used. rule
  3. MINOR interactive_transaction_cli.hpp#L145: Unused private function: 'InteractiveTransactionCli::parseRevokePermission' rule
  4. MINOR postgres_block_index.hpp#L54: Unused private function: 'PostgresBlockIndex::indexAccountAssets' rule
  5. MINOR postgres_block_query.hpp#L64: Unused private function: 'PostgresBlockQuery::getBlockIds' rule
  6. MINOR postgres_block_query.hpp#L72: Unused private function: 'PostgresBlockQuery::getBlockId' rule
  7. MINOR postgres_block_query.hpp#L82: Unused private function: 'PostgresBlockQuery::callback' rule
  8. MINOR ordering_init.cpp#L55: The function 'initOrderingGate' is never used. rule
  9. MINOR pb_common.cpp#L54: The function 'serializeAsset' is never used. rule
  10. MINOR pb_common.cpp#L71: The function 'serializeDomain' is never used. rule

@neewy neewy merged commit 38dd0a1 into master Aug 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.