exonum v0.7 Release Notes

Release Date: 2018-04-11 // about 6 years ago
  • ๐Ÿ’ฅ Breaking Changes

    exonum

    • ๐Ÿ“œ POST-requests are now handled with bodyparser crate, so all the parameters must be passed in the body. (#529)

    • ProofListIndex and ProofMapIndex root_hash method has been renamed to merkle_root. (#547)

    • Proofs of existence / absence for ProofMapIndexs have been reworked. They now have a linear structure with two components: key-value pairs, and additional proof information allowing to restore the Merkle root of the entire index. MapProof interface has been reworked correspondingly. (#380)

    Migration path:

    • Consult documents for the updated workflow for creation and verification of MapProofs.
    • See the README in the storage::proof_map_index module for theoretical details about the new proof structure.

      • with_prefix constructor of all index types has been renamed to new_in_family. Now it uses index_id instead of prefixes. Moreover, blockchain::gen_prefix method has been removed. Instead, any type that implements StorageKey trait, can serve as an index_id. (#531)
      • Several Schema's methods have been renamed (#565):
    • tx_location_by_tx_hash to transactions_locations.

    • block_txs to block_transactions.

      • SystemTime previously used as storage key or value turned out to show different behavior on different platforms and, hence, has been replaced with chrono::DateTime<Utc> that behaves the same in any environment. (#557)

    Migration path:

    • Replace all SystemTime fields with chrono::DateTime<Utc> ones.
    • Use DateTime::from and into() methods to convert your existing SystemTime instances into suitable type when constructing transactions or working with database.

      • Blockchain method tx_from_raw() now returns Result<Box<Transaction>, MessageError> instead of Option<Box<Transaction>>. (#567)
      • events module becomes private. (#568)
      • CryptoHash trait is no longer implemented for Hash. (#578)
      • ๐Ÿšš network_id attribute has been removed from NodeInfo and RawMessage. HEADER_LENGTH remains the same, first byte of RawMessage is now reserved and always set to 0. (#579)
      • exonum::explorer module has been reworked to add new functionality. (#535, #600) In particular:
    • The explorer now allows to iterate over blocks in the blockchain in the given height range, replacing old blocks_range method.

    • block_info and tx_info methods of the explorer are renamed to block and transaction respectively.

    • TransactionInfo moved from the api::public module to the explorer module.

    • BlocksRange moved from the explorer module to the api::public module.

    • TxInfo is renamed to CommittedTransaction.

    • BlockInfo fields are private now, yet accessible with getter methods.

    Migration path:

    • Rename imported types and methods as specified above
    • Use explicit type parameter in TransactionInfo and CommittedTransaction (e.g., TransactionInfo<serde_json::Value> or TransactionInfo<MyTransaction>) if you need to deserialize transaction-related data returned from the explorer HTTP API.
    • Consult explorer module docs for further possible changes in API.

      • validators-count command-line parameter has been added. Now, when generating config template using generate-template command, you must specify the number of validators. (#586)
      • ๐Ÿ‘€ majority_count parameter has been added to the StoredConfiguration. See exonum-configuration changes for more details. (#546)

    โœ… exonum-testkit

    • โช Rollback mechanism in Testkit is reworked to work with checkpoints (#582):
      • old rollback by blocks in Testkit was removed;
      • checkpoint method was introduced to set checkpoints;
      • new rollback rolls back to the last set checkpoint.

    Migration path:

    • Replace every old rollback(blocks) by a pair of checkpoint() and rollback().

      • โœ… Testkit api now contains two methods to work with the transaction pool (#549):
    • is_tx_in_pool - for checking transaction existence in the pool;

    • add_tx - for adding a new transaction into the pool.

    Migration path:

    • Instead of calling mempool(), one should use is_tx_in_pool or add_tx methods.

      • โœ… TestKitApi::get_err method now returns ApiError, rather than a deserialized object, as it is for get. For checking such results in tests you may want to use assert_matches.

    ๐Ÿ”ง exonum-configuration

    • ๐Ÿ”ง majority_count: Option<u16> configuration parameter is introduced. Allows to increase the threshold amount of votes required to commit a new configuration proposal. By default the number of votes is calculated as 2/3 + 1 of total validators count. (#546)

    exonum-time

    • SystemTime has been replaced with chrono::DateTime<Utc>, as it provides more predictable behavior on all systems. (#557)

    ๐Ÿ†• New Features

    exonum

    • ExecutionError::with_description method now takes Into<String> instead of String which allows to pass &str directly. (#592)

    • ๐Ÿ†• New database field added to the NodeConfig. This optional setting adjusts database-specific settings, like number of simultaneously opened files. (#538)

    • ExecutionError::with_description method now takes Into<String> instead of String which allows to pass &str directly. (#592)

    • ๐Ÿ†• New database field added to the NodeConfig. This optional setting adjusts database-specific settings, like number of simultaneously opened files. (#538)

    • โž• Added v1/user_agent endpoint with information about Exonum, Rust and OS versions. (#548)

    • ProofMapIndex now allows to retrieve a proof of presence / absence for an arbitrary number of elements at one time with the help of get_multiproof method. Correspondingly, MapProof allows to verify proofs for an arbitrary number of elements. (#380)

    • storage::UniqueHash trait that represents a unique, but not necessary cryptographic hash function, is introduced. (#579)

    • โž• Added the opportunity to parse configuration files with missing empty structures. Fields of such structures are equal to the default values. (#576)

    • CryptoHash, Field, StorageKey and StorageValue traits are implemented for the uuid::Uuid. (#588)

    • Display trait is implemented for types from the crypto module. (#590)

    • transactions! macro now allows empty body. (#593)

    โœ… exonum-testkit

    • create_block* methods of the TestKit now return the information about the created block. (#535)

    • โœ… TestKit::explorer() method allows to access the blockchain explorer. (#535)

    exonum-cryptocurrency-advanced

    • A more complex example has been added featuring best practices for service writing. (#595)

    Internal Improvements

    exonum

    • RawTransaction now has its own implementation of fmt::Debug trait instead of #[derive(Debug)]. The template of RawTransactionโ€™s debug message is Transaction { version: #, service_id: #, message_type: #, length: #, hash: Hash(###) }. (#603)

    • Non-committed transactions are now stored persistently in the storage instead of memory pool. (#549)

    • ๐Ÿšš Sandbox tests have been moved inside of the exonum core. (#568)

    • The requested transactions in the TransactionsRequest are now sent by batches, rather than one by one. The number of batches depends on the size limits of the message. (#583)

    โœ… exonum-testkit

    • โœ… Request logging for TestKitApi now encompasses all requests. The log format is slightly changed to allow for the generic request / response form. (#601)