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 theafter_transactions
. (#1577)before_transactions
andafter_transactions
hooks in Rust services now return aResult
. 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 usingBlockWithTransactions
. (#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
andService
in Rust runtime have been removed. (#1553)โก๏ธ
commit_service
has been renamed to theupdate_service_status
and now takesInstanceStatus
as an additional argument.start_adding_service
has been renamed toinitiate_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 callingblockchain::Schema::height
withinafter_transactions
hook will cause a panic for a builtin service. (#1619)๐
proposer_id
field inBlock
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), toCallContext
(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 fromruntime::
);blockchain::FatalError
public re-export;blockchain::InstanceCollection
structure;Blockchain::pool_size
,Blockchain::get_saved_peers
andBlockchain::remove_peer_with_pubkey
methods;helpers::path_relative_from
function;helpers::ZeroizeOnDrop
trait;helpers::Milliseconds
type;helpers::config
andhelpers::user_agent
modules;helpers::generate_testnet_config
,helpers::create_rust_runtime_and_genesis_config
andhelpers::clear_consensus_messages_cache
functions;impl_serde_hex_for_binary_value
macro (moved tomerkledb
);proto
module;runtime::error
module (catch_panic
was added to the list of public re-exports fromruntime::error
).
node
module and P2P messages from themessage
module (except forAnyTx
andPrecommit
) 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 thetype=core
query. To get the sources of an artifact, use querytype=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 separateexonum-rust-runtime
crate. (#1641)update_service_status
now does not return a value. (#1659)๐
BlockchainBuilder::build
now returnsBlockchainMut
instead ofResult
. (#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
andCommonError
. (#1680)Common
variant has been added to theErrorKind
enum. (#1680)๐
api
module of theexonum
crate has been moved to 2 separate crates (#1690):exonum-api
crate defining the base HTTP wrapperexonum-system-api
crate implementing system API endpoints
Added a new method
initiate_resuming_service
to theRuntime
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 theexonum_rust_runtime::CallContext
so there is no need to useCallContext
anymore. Public fields inExecutionData
has been replaced by the corresponding getters.- Direct
fork
access inExecutionContext
has been replaced by theBlockchainData::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 fromexonum.messages
toexonum
package. (#1756)BlockchainBuilder
now acceptsGenesisConfig
as a separate argument, rather than a part ofnew
constructor. The config may be skipped if the blockchain is guaranteed to be initialized. (#1761)
exonum-cli
supervisor-mode
parameter has been added forgenerate-template
subcommand. (#1598)NodeBuilder::with_service
has been renamed to thewith_rust_service
. (#1765)
exonum-crypto
- ๐ฆ Protobuf declarations were organized according to their packages. (#1756)
exonum-explorer
- The field
content
of theCommittedTransaction
struct and theInPool
variant of theTransactionInfo
enum has been renamed tomessage
. (#1721)
exonum-supervisor
Supervisor
structure isn't generic anymore. (#1587)๐
DeployConfirmation
structure was renamed toDeployResult
and extended withsuccess
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
andValues
. (#1628)๐
SparseListIndex::indices
method was renamed toSparseListIndex::indexes
. (#1629)AccessExt::touch_index
method has been replaced withindex_type
. (#1630)Public structures and enums were made non-exhaustive. (#1710)
CopyAccessExt
trait has been introduced. This trait is helpful for references implementingAccess
, such as&Fork
or&dyn Snapshot
. Methods fromAccessExt
trait acceptself
by reference now. (#1739)ProofPath
serialization during map hash computations was unified. It now usesLEB128(bit_length) || bytes
format, which was previously used for branches, but not for a single-entry maps. (#1743)Serialization of
ProofPath
s withinMapProof
Protobuf messages was changed to a more compact and implementation-independent format. (#1743)MapProof
Protobuf messages now serialize keys according to theirBinaryValue
implementation, rather thanBinaryKey
. (#1743)All index types now share a common set of iterators:
Entries
,Keys
andValues
. (#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 toMapIndex
/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 orauto_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
andTestKit::probe
methods.
๐
TestKitBuilder::create
method was renamed tobuild
. (#1740)โ
TestNode
now returnsKeyPair
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 anExecutionError
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 abefore_transactions
hook,v1/call_status/after_transactions
- gets the status of anafter_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
methodnext_height
was added as a non-panicking alternative toheight
. (#1619)New method
in_genesis_block
was added to theCallContext
to check if the service hook is being executed for the genesis block. (#1619)๐ New
api::Error
variants were added:Gone
andMovedPermanently
. (#1607)๐ API endpoints are now can be marked as deprecated. (#1607)
โ Added
ProtobufConvert
forVerified
,BlockProof
andIndexProof
. (#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 toKeyPair
. (#1761)
exonum-cli
โ Added maintenance command
restart-migration
to restart migration script. (#1728)Added
with_instance
andwith_default_rust_service
methods toNodeBuilder
, 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
calledProofEntry
, which participates in the state aggregation. (#1553)โ Added support of unsized keys to
MapIndex
andProofMapIndex
. (#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 tomerkledb
. (#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 separateexonum-node
crate. (#1698)
exonum-rust-runtime
๐ Rust runtime module was moved from the
exonum
crate into the separateexonum-rust-runtime
crate. (#1641)CallContext
has been replaced by theExecutionContext
. (#1711)
exonum-supervisor
๐ง
Supervisor
service now can have initial configuration and implementsConfigure
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 theConfigPropose
. - Added
ResumeService
variant to theConfigChange
enumeration.
- Added
๐ 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 thetest-suite/consensus-tests
. (#1627)๐ Some of general-purpose tests were moved to the
test-suite/node-tests
. (#1633)
๐ Bug Fixes
exonum-merkledb
๐
Snapshot
implementation forPatch
has been fixed. The previous implementation could lead to stale reads from aPatch
or aFork
. (#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 exceeding2 ** 56
. (#1768)