exonum v0.12.0 Release Notes

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

    exonum

    • ๐Ÿ‘€ Module storage has been replace by exonum-merkledb crate. See related section
    • Signatures of methods Service::initialize and Service::before_commit has been changed. Now they take immutable reference to Fork instead of mutable. (#1293)

    • Trait BinaryForm has been replaced by BinaryValue. (#1298)

    To implement BinaryValue for types that implements Protobuf::Message use impl_binary_value_for_pb_message macros.

    • ๐Ÿ‘€ Module storage has been replaced by exonum-merkledb crate. See related section in changelog for details. (#1293)

    • Bootstrapping workflow has been simplified (#1292)

    generate-config subcommand now uses single OUTPUT_DIR instead of set of options. So to generate node config you should write something like example bellow.

      cargo run --bin exonum-timestamping -- \
        generate-template /tmp/exonum/template.toml --validators-count 4
    
      cargo run --bin exonum-timestamping -- \
        generate-config /tmp/exonum/template.toml /tmp/exonum/cfg/0 \
          --peer-address 0.0.0.0:8000
      cargo run --bin exonum-timestamping -- \
        generate-config /tmp/exonum/template.toml /tmp/exonum/cfg/1 \
          --peer-address 0.0.0.0:8001
      cargo run --bin exonum-timestamping -- \
        generate-config /tmp/exonum/template.toml /tmp/exonum/cfg/2 \
          --peer-address 0.0.0.0:8002
      cargo run --bin exonum-timestamping -- \
        generate-config /tmp/exonum/template.toml /tmp/exonum/cfg/3 \
          --peer-address 0.0.0.0:8003
    
      cargo run --bin exonum-timestamping -- \
        finalize /tmp/exonum/nodes/0/sec.toml /tmp/exonum/nodes/0/node.toml \
          --public-configs /tmp/exonum/cfg/{0,1,2,3}/pub.toml
    
      cargo run --bin exonum-timestamping -- \
        run -d /tmp/exonum/db/0 -c /tmp/exonum/nodes/0/node.toml
    
    • explorer/v1/block endpoint returns a response in a "flat" format. (#1386)

    • explorer/v1/blocks endpoint with add_blocks_time param switched on now returns median precommit times in the time field within each returned block, rather than in a separate array. (#1278)

    • system/v1/mempool endpoint has been renamed into system/v1/stats. An additional field in the response of the endpoint was added. The field corresponds to the total number of transactions in the blockchain. (#1289)

    • system/v1/mempool endpoint has been renamed into system/v1/stats. An additional field in the response of the endpoint was added. The field corresponds to the total number of transactions in the blockchain. (#1289)

    exonum-merkledb

    • โž• Added restrictions to index names. Allowable characters in index name: ASCII characters, digits, underscores and dashes. (#1388)

    • โž• Added Debug implementation for Database, Snapshot, Iterator dynamic traits (#1363)

    • ๐Ÿ”„ Changed storage layout (#1293)

      • Changed indexes metadata layout in the database.
      • Introduced a generic IndexState structure that can be used to store global index properties like total number of items.
    • ๐Ÿ”„ Changed ProofMapIndex hashing rules for branch nodes and root node. Branch nodes is hashing now with 0x04 prefix, root node with 0x03 (#1293).

    • ๐Ÿ“‡ Renamed method merkle_root of ProofMapIndex and ProofListIndex to object_hash (#1293).

    • Several mutable indexes now can be create from immutable reference to Fork (#1293)

    • ๐Ÿ˜Œ Relaxed trait bounds for the ProofMapIndex keys (#1293)

    Now keys should just implement BinaryKey trait instead of the ProofMapKey, which will be ordered according to their binary representation, as in the MapIndex.

    • ๐Ÿ”„ Changed ProofListIndex hashing rules for leaf nodes and branch nodes according to the certificate transparency specification. Leaf nodes contain hashes with 0x00 prefix, branch nodes - with 0x01. (#1293)

    • StorageValue and StorageKey have been renamed to the BinaryValue and BinaryKey. (#1293)

      • Added to_bytes method to the BinaryValue trait which doesn't consume original value instead of the into_bytes.
      • BinaryKey::write now returns total number of written bytes.
      • CryptoHash has been replaced by the ObjectHash.
    • ๐Ÿ”„ Changed the hash algorithm of the intermediate nodes in ProofMapIndex. (#1293)

    ProofPath now uses compact binary representation in the BranchNode hash calculation.

    Binary representation is |bits_len|bytes|, where:

    • bits_len - total length of the given ProofPath in bits compressed by the leb128 algorithm
    • bytes - non-null bytes of the given ProofPath, i.e. the first (bits_len + 7) / 8 bytes.

    exonum-crypto

    • โœ‚ Removed deprecated CryptoHash trait, use exonum-merkledb::ObjectHash instead (#1361)

    ๐Ÿ†• New features

    exonum

    • ๐Ÿ†• New endpoint: v1/transactions/subscribe, which subscribe to new transaction events. This endpoint accept optional parameters: service_id and message_id (message_id as in derive macro TransactionSet). (#1335)

    • ๐Ÿ†• New endpoint: v1/ws, which open websocket connection and allow to set multiple subscription (for blocks and transaction, filtered by service and transaction id) and send transactions (in hex, like in explorer) to blockchain (examples can be found in related pull request). (#1335)

    ๐Ÿ› Bug Fixes

    โœ… exonum-testkit

    • ๐Ÿ›  Fixed TestKit::add_tx() method, which previously did not persist transactions. (#1278)

    Internal improvements

    exonum

    • ๐Ÿ‘ explorer/v1/blocks endpoint supports add_precommits param, which supplies each returned block with the precommits field. (#1278)

    • explorer/v1/blocks endpoint allows to specify the lower bound on the returned block height with the earliest query param. (#1278)

    • โž• Added ProtobufConvert implementation for byte array with fixed sizes (#1279)

    • โž• Added service_name getter to the TransactionContext. (#1274)

    • ๐Ÿ‘ Allowed to use symbol - in index names. (#1277)

    • rocksdb crate is now used instead of exonum_rocksdb. (#1286)

    • โž• Added a new endpoint system/v1/services for displaying information about available services. (#1288)

    • Endpoints explorer/v1/block and explorer/v1/transactions were extended with adding additional fields service_id and time. (#1386)

    • โž• Added tx_cache field to State to cache incoming transactions before adding them to persistent pool. (#1398)

    • โž• Added new request message PoolTransactionsRequest to obtain pool transactions from another peers. (#1404)

    • Endpoints explorer/v1/block and explorer/v1/transactions were extended with adding additional fields service_id and time. (#1386)

    exonum-merkledb

    • โšก๏ธ Updated ProofMapIndex data layout. (#1293)

    Path to the root node in merkle patricia tree now has been stored in the index state.

    • ๐Ÿ†• New API for getting and creating indexes. (#1293)

      • Now indexes can be accessed via immutable references from Snapshot and mutable/immutable references from Fork.
      • Introduced method fork::get_object to get or create object by address.
      • get_object_existed and get_object_existed_mut methods of Fork and Snapshot returns optional references to index.
    • rocksdb crate is now used instead of exonum_rocksdb. (#1286)

    • โž• Added a new endpoint system/v1/services for displaying information about available services. (#1288)

    • rocksdb crate is now used instead of exonum_rocksdb. (#1286)

    • โž• Added From<Patch> trait implementation to Fork. (#1403)

    โœ… exonum-testkit

    • โœ… Implemented "stopping" and "resuming" a TestKit, allowing to emulate node restarts. (#1278)