exonum v1.0.0-rc.1 Release Notes

Release Date: 2020-02-07 // about 4 years ago
  • ๐Ÿ’ฅ Breaking changes

    exonum

    • before_commit hook was renamed to the after_transactions. (#1577)

    • before_transactions and after_transactions hooks in Rust services now return a Result. The semantics is the same as for transactions; an error or panic in the hook will lead to the rollback of the blockchain state. (#1576)

    • Errors occurring while executing transactions and before_transactions / after_transactions hooks are now aggregated within each block, rather than globally. Errors can be retrieved using BlockWithTransactions. (#1576)

    • The Rust interface and Protobuf presentation of ExecutionError have been reworked. Error fields were made private and information about a failing call was added. (#1585)

    • IntoExecutionError macro was reworked into a separate trait, ExecutionFail, and a corresponding derive macro. (#1585)

    • State hash aggregation is now performed automatically by MerkleDB. The relevant methods in Runtime and Service in Rust runtime have been removed. (#1553)

    • โšก๏ธ commit_service has been renamed to the update_service_status and now takes InstanceStatus as an additional argument. start_adding_service has been renamed to initiate_adding_service to better distinguish between starting and stopping a service. (#1605)

    • after_transactions hook is now invoked on the genesis block for the builtin services. Note that calling blockchain::Schema::height within after_transactions hook will cause a panic for a builtin service. (#1619)

    • ๐Ÿšš proposer_id field in Block has been moved to additional block headers. (#1602)

    • Interaction with services from the Rust runtime has been changed. Instead of using the Transaction trait, it is now possible to use service interfaces directly as Rust traits. These interface traits can be applied to a keypair (to generate signed transactions), to CallContext (to call another service) and some other types. See Rust runtime docs for more details. (#1606)

    • ๐Ÿšš The following public APIs were removed/made private: (#1629, #1671)

      • blockchain::{error reexports} (available from runtime::);
      • blockchain::FatalError public re-export;
      • blockchain::InstanceCollection structure;
      • Blockchain::pool_size, Blockchain::get_saved_peers and Blockchain::remove_peer_with_pubkey methods;
      • helpers::path_relative_from function;
      • helpers::ZeroizeOnDrop trait;
      • helpers::Milliseconds type;
      • helpers::config and helpers::user_agent modules;
      • helpers::generate_testnet_config, helpers::create_rust_runtime_and_genesis_config and helpers::clear_consensus_messages_cache functions;
      • impl_serde_hex_for_binary_value macro (moved to merkledb);
      • proto module;
      • runtime::error module (catch_panic was added to the list of public re-exports from runtime::error).
    • node module and P2P messages from the message module (except for AnyTx and Precommit) were moved to a separate crate, exonum-node. The moved P2P messages were made private along with types / methods logically related to the consensus algorithm implementation (i.e., NodeHandler and types used by it). (#1698)

    • The artifact identifier now has first-class semantic version. Previously, it was specific to the Rust runtime. (#1590)

    • The name field of the artifact identifier cannot contain : symbol. (#1590)

    • The format of the proto-sources endpoint in the Rust runtime has been changed. To get the core Protobuf sources, use the endpoint with the type=core query. To get the sources of an artifact, use query type=artifact&name=$name&version=$version, where $name and $version are replaced with appropriate values. (#1590)

    • ๐Ÿšš Rust runtime module was moved from the exonum crate into the separate exonum-rust-runtime crate. (#1641)

    • update_service_status now does not return a value. (#1659)

    • ๐Ÿ— BlockchainBuilder::build now returns BlockchainMut instead of Result. (#1659)

    • A type for a position of transaction in the block has been changed for u32. (#1668)

    • DispatcherError has been split into two different types: CoreError and CommonError. (#1680)

    • Common variant has been added to the ErrorKind enum. (#1680)

    • ๐Ÿšš api module of the exonum crate has been moved to 2 separate crates (#1690):

      • exonum-api crate defining the base HTTP wrapper
      • exonum-system-api crate implementing system API endpoints
    • Added a new method initiate_resuming_service to the Runtime trait. This method is used to resume a previously stopped services. (#1693)

    • ExecutionContext has been reworked (#1711)

      • ExecutionContext has been extended by the methods from the exonum_rust_runtime::CallContext so there is no need to use CallContext anymore. Public fields in ExecutionData has been replaced by the corresponding getters.
      • Direct fork access in ExecutionContext has been replaced by the BlockchainData::unstructured_access which returns readonly access to whole blockchain data.
    • Public structures and enums were made non-exhaustive. (#1710)

    • Blockchain data access from the ExecutionContext after an error in a nested call is prohibited. (#1733)

    • ๐Ÿ“ฆ Protobuf declarations were organized according to their packages and, in case of the exonum.runtime package, split into smaller chunks. The core messages were moved from exonum.messages to exonum package. (#1756)

    • BlockchainBuilder now accepts GenesisConfig as a separate argument, rather than a part of new constructor. The config may be skipped if the blockchain is guaranteed to be initialized. (#1761)

    exonum-cli

    • supervisor-mode parameter has been added for generate-template subcommand. (#1598)

    • NodeBuilder::with_service has been renamed to the with_rust_service. (#1765)

    exonum-crypto

    • ๐Ÿ“ฆ Protobuf declarations were organized according to their packages. (#1756)

    exonum-explorer

    • The field content of the CommittedTransaction struct and the InPool variant of the TransactionInfo enum has been renamed to message. (#1721)

    exonum-supervisor

    • Supervisor structure isn't generic anymore. (#1587)

    • ๐Ÿš€ DeployConfirmation structure was renamed to DeployResult and extended with success field. (#1648)

    • Error code values were changed and split into several enum representing sub-groups. (#1680)

    exonum-merkledb

    • The crate has been restructured, indexes are now located in separate module. Indexes iterators names has been shortened to Iter, Keys and Values. (#1628)

    • ๐Ÿ“œ SparseListIndex::indices method was renamed to SparseListIndex::indexes. (#1629)

    • AccessExt::touch_index method has been replaced with index_type. (#1630)

    • Public structures and enums were made non-exhaustive. (#1710)

    • CopyAccessExt trait has been introduced. This trait is helpful for references implementing Access, such as &Fork or &dyn Snapshot. Methods from AccessExt trait accept self by reference now. (#1739)

    • ProofPath serialization during map hash computations was unified. It now uses LEB128(bit_length) || bytes format, which was previously used for branches, but not for a single-entry maps. (#1743)

    • Serialization of ProofPaths within MapProof Protobuf messages was changed to a more compact and implementation-independent format. (#1743)

    • MapProof Protobuf messages now serialize keys according to their BinaryValue implementation, rather than BinaryKey. (#1743)

    • All index types now share a common set of iterators: Entries, Keys and Values. (#1762)

    • KeySetIndex::insert now takes the element by reference. (#1762)

    • ๐Ÿ‘ KeySetIndex now supports unsized keys. Its getter methods are no longer parameterized by the key type, similar to MapIndex / ProofMapIndex. (#1762)

    exonum-proto

    • ๐Ÿ“ฆ Protobuf declarations were organized according to their packages. (#1756)

    exonum-rust-runtime

    • Service interfaces now have to specify method IDs with either interface_method attribute or auto_ids option. (#1701)

    • ๐Ÿšš Service interface methods now can be marked as removed. (#1707)

    โœ… exonum-testkit

    • ๐Ÿšš The following public APIs were removed/made private: (#1629)

      • compare module;
      • txvec macro;
      • TestKit::probe_all and TestKit::probe methods.
    • ๐Ÿ— TestKitBuilder::create method was renamed to build. (#1740)

    • โœ… TestNode now returns KeyPair instead of a (PublicKey, SecretKey) tuple. (#1761)

    exonum-time

    • Modules were made private, crate now provides re-exports of necessary types instead. (#1716)

    ๐Ÿ†• New features

    exonum

    • before_transactions hook for services was introduced. (#1577)

    • โœ… ErrorMatch was introduced to test (e.g., using the testkit) that an ExecutionError has an expected type, error message and/or location. (#1585)

    • We introduced a set of public endpoints to retrieve the status of calls executed within a block:

      • v1/call_status/transaction - gets the status of a transaction,
      • v1/call_status/before_transactions - gets the status of a before_transactions hook,
      • v1/call_status/after_transactions - gets the status of an after_transactions hook. (#1612)
    • Service instances can now be stopped.

    Active service instance can be stopped by the corresponding request to the Supervisor. Stopped service no more participates in the business logic, i.e. it does not execute transactions, process events, provide user APIs, etc. Service data becomes unavailable to other services, but still exists. The name and identifier remain reserved for the stopped service and cannot be used again for adding new services. (#1605)

    • ๐Ÿ†• New blockchain::Schema method next_height was added as a non-panicking alternative to height. (#1619)

    • New method in_genesis_block was added to the CallContext to check if the service hook is being executed for the genesis block. (#1619)

    • ๐Ÿ†• New api::Error variants were added: Gone and MovedPermanently. (#1607)

    • ๐Ÿ—„ API endpoints are now can be marked as deprecated. (#1607)

    • โž• Added ProtobufConvert for Verified, BlockProof and IndexProof. (#1643)

    • Slash (/) is now allowed to be a part of artifact/instance name. (#1681)

    ๐Ÿ— exonum-build

    • ๐Ÿ— exonum-build now fully supports hierarchical paths to Protobuf files. (#1756)

    • It is possible to opt out of including file sources into the output generated by the crate. (#1756)

    • ๐Ÿ‘ Blockchain::new now supports any type convertible to KeyPair. (#1761)

    exonum-cli

    • โž• Added maintenance command restart-migration to restart migration script. (#1728)

    • Added with_instance and with_default_rust_service methods to NodeBuilder, which start service instances immediately after genesis block creation. (#1765)

    • โž• Added NodeBuilder::development_node constructor, which can be used to quickly set up a single-node development network. (#1765)

    exonum-crypto

    • KeyPair now can has constructors for generating a random keypair and generating a keypair from the specified seed. (#1761)

    exonum-merkledb

    • MerkleDB now performs automated state aggregation allowing to construct proofs for its contents. Hashed indexes which are not a part of a group participate in this aggregation. Consult crate docs for more details on how aggregation works. (#1553)

    • โž• Added hashed version of Entry called ProofEntry, which participates in the state aggregation. (#1553)

    • โž• Added support of unsized keys to MapIndex and ProofMapIndex. (#1621, #1626)

    • โž• Added mechanism to extend block header. Block now contains key-value storage additional_headers which can contain binary data. (#1602)

    • ๐Ÿšš TemporaryDB can now be cleared. This will remove contents of all indexes and erase index metadata. (#1630)

    • impl_serde_hex_for_binary_value macro was moved from core to merkledb. (#1629)

    • It is now possible to iterate over keys of the indexes within a group. (#1662)

    • Unsafe optimizations / experimental features are now behind a yolo feature, which is off by default. (#1740)

    • ๐Ÿ‘ MerkleDB now provides enumerations for all supported types of DB accesses which can be used to simplify generic code (e.g., in bindings). (#1747)

    • It is now possible to obtain readonly access to fork data with static lifetime. (#1763)

    exonum-node

    • ๐Ÿšš Node logic (including P2P networking and consensus algorithm) was moved from the exonum crate into the separate exonum-node crate. (#1698)

    exonum-rust-runtime

    • ๐Ÿšš Rust runtime module was moved from the exonum crate into the separate exonum-rust-runtime crate. (#1641)

    • CallContext has been replaced by the ExecutionContext. (#1711)

    exonum-supervisor

    • ๐Ÿ”ง Supervisor service now can have initial configuration and implements Configure interface. (#1587)

    • ConfigChange::StopService has been added to make requests to stop the service instance. (#1605)

    • ๐Ÿ†• New private endpoint deploy-status was added. (#1648)

    • โž• Added support for resuming previously stopped services. (#1706)

      • Added resume_service method to the ConfigPropose.
      • Added ResumeService variant to the ConfigChange enumeration.
    • ๐Ÿ‘ Supervisor now supports migrations. (#1727)

    exonum-middleware-service

    • Added middleware service that can batch transactions and perform checked calls (calls that are executed if the target service corresponds to a specific artifact and version requirement). (#1590)

    Internal Improvements

    exonum

    • ๐Ÿšš sandbox module was moved to the test-suite/consensus-tests. (#1627)

    • ๐Ÿšš Some of general-purpose tests were moved to the test-suite/node-tests. (#1633)

    ๐Ÿ› Bug Fixes

    exonum-merkledb

    • ๐Ÿ›  Snapshot implementation for Patch has been fixed. The previous implementation could lead to stale reads from a Patch or a Fork. (#1611)

    • ๐Ÿ›  Maximum height in ProofListIndex was fixed from the bogus value 58 to 56. (#1762)

    • ๐Ÿšš Bogus setting of the empty key was removed for ListIndex. (#1762)

    • ProofListIndex now properly processes all index values; previously, some of its methods panicked if called with an index exceeding 2 ** 56. (#1768)