exonum v0.13.0-rc.2 Release Notes

Release Date: 2019-12-04 // over 4 years ago
  • ๐Ÿ’ฅ Breaking changes

    exonum

    Most important : new Dynamic Services feature was introduced. For details see
    the Dynamic Services section of the changelog.

    โšก๏ธ Used rust version is updated to 1.38.0. (#1481)

    create_checkpoint method has been implemented for the RocksDB struct.
    This method uses RocksDB checkpoints functionality under the hood.

    NotFound error message for explorer/v1/block endpoint now includes
    the actual blockchain height. (#1498)

    ๐Ÿšš system/v1/rebroadcast endpoint has been removed. (#1445)

    โž• Added a possibility to specify compression algorithm for the database. (#1447)

    โšก๏ธ Updated hex dependency with changes in the methods signatures of the ToHex
    trait. (#1468)

    Validator keys are now derived from single master key. Master key is
    stored in encrypted file. (#1459)

    ๐Ÿ’ป Command line parameters --service-key-pass and --consensus-key-pass was
    โœ‚ removed in favor of --master-key-pass parameter. For example now you can
    โš™ run the node with the command below. (#1459)

    cargo run -- run -d 0/db/ -c 0/node.toml --master-key-pass pass:123
    

    โœ… StoppedTestKit::resume accepts list of runtimes instead of a list of services.

    โœ‚ Removed obsolete TestKit::blockchain_mut method and TestKit::blockchain
    now returns value instead of reference.

    Dot symbol is not allowed in service names anymore. (#1558)

    Services can now use BlockchainData and SnapshotExt types to access data
    from the blockchain in a more structured manner. (#1523)

    GenesisConfig is extracted into separate entity. BlockchainBuilder, Node
    โœ… and Testkit explicitly accepts it during creation. (#1541)

    โž• Added DefaultInstance trait for declaration of builtin services. (#1541)

    exonum-merkledb

    Nested proofs for ProofListIndex are replaced with a flat
    (non-recursive) format. (#1450)

    Differentiated (read-only / read-write) access to the database
    was introduced. (#1523)

    It is now possible to have readonly access to indexes given a Fork
    via a ReadonlyFork wrapper. Readonly access works like RefCell::borrow
    (vs RefCell::borrow_mut for Fork); it is possible to create an
    unlimited number of indexes with readonly access based on the same fork.
    (#1523)

    Service schemas can now use a declarative layout, in which every field
    corresponds to a separate index or a group of indexes. It is possible
    to derive a constructor for such schemas via FromAccess derive macro.
    (#1523, #1562)

    ๐Ÿ†• New index name restrictions has been added. (#1558)

    ๐Ÿ›  Dot symbol is not allowed anymore in indexes with prefixed access.

    Index names starting from __ and not containing a dot . are reserved and
    ๐Ÿ‘‰ used only for system indexes.

    exonum-proto

    • ๐Ÿšš Introduced a new crate exonum-proto. Trait ProtobufConvert is moved
      to this crate. (#1496)

    exonum-protobuf-convert

    Introduced a new crate exonum-protobuf-convert. Derive macro
    ๐Ÿšš ProtobufConvert is moved to this crate. (#1501)

    Derive macro ProtobufConvert now does not derive the BinaryValue and
    ObjectHash traits. There are separate derive macros for them in
    the exonum-derive crate. (#1501)

    ๐Ÿ— exonum-build

    Method protobuf_generate is now private, use exonum_build::ProtobufGenerator
    instead (#1496).

    ๐Ÿšš Method ProtobufGenerator::frequently_used has been removed (#1581).

    exonum-crypto

    Methods read_keys_from_file and generate_keys are moved to new keys
    module in the exonum. (#1459)

    Protobuf serialization for crypto types is now implemented in the exonum-crypto
    crate. (#1496)

    Dynamic Services Feature

    Overview

    In exonum 0.13.0-rc.2, a new service workflow is introduced, named
    "Dynamic Services".

    Key points of this feature are the following:

    ๐Ÿ‘ exonum now supports different environments of code execution (runtimes).
    0๏ธโƒฃ Only native rust runtime is enabled by default, but support of
    different programming languages can be added quite easily.

    ๐Ÿ‘€ For details see the Runtime trait docs and the
    โš™ sample_runtime example.

    Services are not statically tied to the compiled binary anymore. There is
    ๐Ÿ‘Œ support of adding new service types (aka artifacts) dynamically and starting new
    instances of services.

    ๐Ÿ‘€ For details see runtime module docs.

    Services now can have initialization parameters, provided within service start
    procedure.

    ๐Ÿ”ง Services now support configuration changes via Configure interface.

    ๐Ÿ”ง configuration service was replaced with the supervisor service, which is
    ๐Ÿš€ capable of not only changing configuration, but of deploying and starting
    ๐Ÿ‘€ services as well. For details see supervisor service.

    Migration Guide

    ๐Ÿš€ There are a lot of backward-incompatible changes introduced within 0.13.0-rc.2 release candidate.
    So to make the changes apparent, compare the Cryptocurrency example service versions
    ๐Ÿš€ for 0.12.1 and 0.13.0 releases.

    Key points:

    Merkledb schema is now declarative and can contain indices as fields.

    Access to the database is now isolated for services.
    A service cannot get the write access to another service or the blockchain schema.

    Transactions do not have the execute method anymore. Instead, a service defines
    and implements an interface trait which contains all the business logic.

    0๏ธโƒฃ Services do not launch at the node start by default. For launching a
    service, use an exonum-launcher tool.

    Important PRs for Dynamic Services

    Below you can find a list of pull requests which have significant meaning for the implementation of the Dynamic Services feature. Pull requests are ordered chronologically.

    ๐Ÿคก #1253: Interface mocks for dynamic services

    #1263: Add new rust services interface

    #1261: Basic dispatcher functionality

    #1275: Dynamic services integration

    #1345: Implement a new Transaction trait [ECR-3222]

    #1361: FIrst step of persistent dynamic services implementation [ECR-3276]

    #1371: Basic supervisor service implementation [ECR-3291], [ECR-3298]

    โช #1376: Restore system API endpoints

    #1389: Check and improve messages verification procedure [ECR-3272]

    #1446: Service interfaces MVP. [ECR-3474], [ECR-3484]

    ๐Ÿ”ง #1467: Implement Configure interface [ECR-3306]

    #1473: Extract supervisor service from core

    #1482: Add shutdown method into runtime trait

    โšก๏ธ #1484: Implement configuration update logic in Supervisor [ECR-3583]

    #1492: Do start and initialize service at single step [ECR-3222]

    #1537: Finalize Exonum-derive macros [ECR-3800]

    #1538: Supervisor modes [ECR-3794] [ECR-3771]

    Full History of the Dynamic Services Implementation

    Below you can find a list of all pull requests related to the implementation of the Dynamic Services feature. Pull requests are ordered chronologically.

    #1243: Old behavior dispatcher

    ๐Ÿ”€ #1509: Make dispatcher mostly synchronous

    #1245: Add basic runtime env interface + rust implementation

    ๐Ÿคก #1253: Interface mocks for dynamic services

    #1261: Basic dispatcher functionality

    #1263: Add new rust services interface

    ๐Ÿ”ง #1267: Move configuration service to the core

    #1269: Rust artifact and additional functionality for rust runtime.

    ๐Ÿ”ง #1270: Dynamic configuration service

    #1275: Dynamic services integration

    ๐Ÿšš #1287: Remove macro from service interface trait definition

    ๐Ÿ‘ #1290: Add support of state hash calculation into runtimes & services

    ๐Ÿ— #1291: Change service builder and web api.

    #1325: Dynamic services: fix time service compilation

    ๐Ÿšš #1326: Remove genesis_init from dynamic services [ECR-3226]

    ๐Ÿšš #1327: Remove unsafe code from runtimes

    #1330: A small amount of code improvements. [ECR-3222]

    #1331: Rename dispatch to call_info

    โœ… #1332: Fix tests in blockchain module

    โœ… #1334: Fix sandbox tests in dynamic services [ECR-3230]

    #1336: Rename traits methods in dynamic services [ECR-3222]

    โœ… #1337: Fix a lot of tests in dynamic services

    #1338: Refine start_service logic [ECR-3222, ECR-3235]

    โœ… #1340: Fix testkit [ECR-3229]

    #1343: Add service name and id to Service trait methods. [ECR-3235]

    #1345: Implement a new Transaction trait [ECR-3222]

    #1346: Fix transactions benchmarks in dynamic services

    ๐ŸŽ #1348: Fix big performance regression in dynamic services

    #1349: Don't verify SignedMessage during the deserialization

    ๐Ÿ”จ #1350: Refactor signature verification code [ECR-3222]

    #1353: Rework blockchain explorer [ECR-3259]

    โœ… #1354: Fix cargo test --all compilation

    ๐Ÿ”จ #1357: Some refactoring by clippy suggestion

    #1361: FIrst step of persistent dynamic services implementation [ECR-3276]

    #1367: Rename ArtifactSpec to ArtifactId [ECR-3291]

    #1371: Basic supervisor service implementation [ECR-3291], [ECR-3298]

    ๐Ÿ’… #1374: Polish code and make travis almost happy

    #1375: Add deadline_height to StartService transaction [ECR-3298]

    โช #1376: Restore system API endpoints

    ๐Ÿš€ #1378: Finalize artifact deployment logic [ECR-3291]

    #1379: Implement state_hash computation for dispatcher.

    โœ… #1380: Make tests green again.

    #1381: Include proto file sources in artifact information. [ECR-3309]

    #1382: Replace impl_service_dispatcher by the attribute in
    service_interface [ECR-3222]

    #1387: Improve execution error handling for dynamic services [ECR-3236]

    #1389: Check and improve messages verification procedure [ECR-3272]

    #1392: Implement verification for ArtifactId and InstanceSpec
    โœ… with the unit tests [ECR-3360]

    #1393: Add macro to implement hex serde representation
    for the BinaryValue types [ECR-3222]

    ๐Ÿ“š #1394: Update documentation of the messages module [ECR-3275]

    #1396: Document runtime life cycle [ECR-3275]

    โœ… #1405: Dynamic services supervisor tests [ECR-3266]

    #1411: Refine Runtime trait [ECR-3412]

    ๐Ÿš€ #1427: Try to re deploy artifact before registration.

    #1429: Review unwraps in dynamic services [ECR-3419]

    ๐Ÿ“š #1430: Expand documentation on configuration parameters usage [ECR-3463]

    โšก๏ธ #1431: Update dispatcher info to show changes in list
    ๐Ÿš€ of deployed artifacts

    #1432: Refine exonum-derive crate on top of darling [ECR-3343]

    #1434: Replace dispatcher attribute in exonum_service
    by the service_interface in ServiceFactory [ECR-3474]

    ๐Ÿšš #1438: Remove dispatcher reference from Runtime trait

    #1443: Replace fabric module with exonum-cli crate [ECR-3457]

    #1446: Service interfaces MVP. [ECR-3474], [ECR-3484]

    #1451: Add the service interface name option to the proto files

    ๐Ÿšš #1452: Remove default state_hash implementation

    ๐Ÿ”ง #1454: Simplify blockchain configuration [ECR-3357]

    #1462: Fix API Freeze on startup

    #1465: Improve ProtobufConvert for enum variants

    ๐Ÿ”ง #1467: Implement Configure interface [ECR-3306]

    โœ… #1472: Fix some of the testkit ignored doctests

    #1473: Extract supervisor service from core

    โœ… #1476: Improve support for additional runtimes in TestKit [ECR-3444]

    #1482: Add shutdown method into runtime trait

    #1483: Use strings for protobuf files

    โšก๏ธ #1484: Implement configuration update logic in Supervisor [ECR-3583]

    ๐Ÿ‘ #1488: Add support of external runtimes to exonum-cli

    #1489: Avoid waiting in the add_transaction endpoint [ECR-3222]

    #1490: Fix supervisor creation

    ๐Ÿ’… #1491: Polish testkit [ECR-3222]

    #1492: Do start and initialize service at single step [ECR-3222]

    #1493: Document Rust runtime services traits [ECR-3275]

    โœ… #1494: Enhancements in Testkit

    #1495: Implement API endpoints that shows config
    proposals in Supervisor [ECR-3610]

    #1504: Clarify runtime shutdown method [ECR-3696]

    #1505: Proto optimization [ECR-3472]

    ๐Ÿšš #1508: Remove validator_id method from AfterCommitContext

    ๐Ÿ”€ #1509: Make dispatcher mostly synchronous

    #1511: Add includes to proto-sources

    #1514: Use enum to represent ErrorKind [ECR-3717]

    โœ… #1515: Introduce test-suite directory

    ๐Ÿ“š #1517: Clarify SignedMessage documentation [ECR-3478]

    ๐Ÿš€ #1518: Remove data duplication from DeployConfirmation [ECR-3770]

    #1519: Add anonymous lifetimes [ECR-3757]

    #1520: SimpleSupervisor: Verify that config proposal
    is sent by validator [ECR-3742]

    #1521: Implement ObjectHash for SignedMessage

    ๐Ÿšš #1522: Remove ApiContext structure [ECR-3745]

    #1525: Make protobuf artifacts implementation detail

    of Rust runtime [ECR-3776]

    #1526: Sending an empty POST request to /shutdown endpoint
    doesn't work [ECR-3756]

    #1528: Document parts of Rust runtime [ECR-3285]

    ๐Ÿ“„ #1530: Improve Runtime docs

    #1531: ProofMapIndex variants for hashed and raw keys [ECR-3777]

    #1537: Finalize Exonum-derive macros [ECR-3800]

    #1538: Supervisor modes [ECR-3794] [ECR-3771]

    โช #1539: Restore warn(missing_docs) in the Exonum crate [ECR-3821]

    ๐Ÿš€ #1540: Deploy workflow

    #1542: Write proper examples for the Exonum traits derivation [ECR-3822]

    ๐Ÿšš #1544: Remove atty dependency

    ๐Ÿšš #1546: Move multisig module to the supervisor crate [ECR-3823]

    ๐Ÿšš #1547: Remove metrics module

    ๐Ÿšš #1548: Remove TransactionMessage alias [ECR-3222]

    #1549: Encapsulate Blockchain fields [ECR-3222]

    ๐Ÿšš #1550: Remove isolate method [ECR-3820]

    #1552: Assign instance IDs in the Supervisor [ECR-3746]

    โšก๏ธ #1555: Update MerkleDB docs

    #1568: Make DispatcherSchema merkelized again [ECR-3810]

    #1592: Fix node freeze after re-enabling consensus [ERC-3111]

    ๐Ÿ†• New Features

    exonum

    New config params http_backend_config.server_restart_max_retries and
    http_backend_config.server_restart_retry_timeout added into NetworkConfiguration.
    ๐Ÿ”ง They are intended to configure restart settings of the HTTP-server (#1536).

    โœ… exonum now has a python library for implementing integration tests. (#1516)

    BlockchainMut now has a check_tx method used to verify transactions before
    โž• adding them to the transactions pool. Transactions for which check_tx fails
    are considered invalid and can't be included to the block. (#1579)

    exonum-merkledb

    ProofListIndex now implements truncate() and pop() methods, allowing
    to eject elements from the list. (#1455)

    IndexAccess trait is implemented for several new types, notably,
    Rc<dyn Snapshot>, Arc<dyn Snapshot> and Rc<Fork>. (#1455)

    ๐Ÿ‘ HashTag::hash_list() was extended to support values of any appropriate type,
    not only Hash. (#1455)

    ProtobufConvert has been implemented for MapProof (#1512) and ListProof (#1513).

    ๐Ÿ†• New variant of the ProofMapIndex have been introduced - RawProofMapIndex.
    It is used for keys that maps directly to ProofPath, for example Hash and
    PublicKey. (#1531)

    0๏ธโƒฃ By default ProofMapIndex is used for keys that implement ObjectHash.

    For Hash keys both map variants works the same, because ObjectHash
    implementation for Hash returns the hash itself.

    exonum-cli

    Old fabric module is replaced with new exonum-cli crate. (#1443)

    exonum-cli provides a public reexport of structopt crate. (#1461)

    Internal Improvements

    exonum

    system/v1/shutdown endpoint has been modified and now accepts empty POST
    requests. (#1526)

    exonum-protobuf-convert has been replaced with external protobuf-convert
    crate. (#1561)

    ๐Ÿšš keys module has been moved into exonum-keys crate. (#1497)

    exonum-merkledb

    ๐Ÿ”จ ProofListIndex::extend() method has been refactored, leading to up to 10x
    ๐ŸŽ performance improvements for large lists. (#1455)

    ๐Ÿ”จ Proofs building mechanisms have been heavily refactored. (#1460)

    โœ… exonum-testkit

    • ๐Ÿ”ง Configuration change example has been moved to exonum-supervisor crate. (#1582)

    ๐Ÿ— exonum-build

    • Now input directory is always added to includes to reduce boilerplate
      code. (#1581)

    ๐Ÿ› Bug Fixes

    exonum

    • Localhost ports 8080/8081 are now allowed in CORS within the run-dev mode. (#1415)

    exonum-merkledb

    • ๐Ÿ“‡ index_metadata now correctly loads the provided index address name (#1478).