Releases: exonum/exonum
Exonum 0.9 "Halmahera Boobook"
Breaking Changes
exonum
-
Commandtrait inhelpers::fabricmodule became public. (#778)Migration path:
If you override
ServiceFactory::commandmethod and do a match by a command name, just adduse helpers::fabric::Commandimport. -
schema_versionfield inBlockhas been removed. (#774) -
Storage in exonum is now versioned. Old databases will not work with this update. (#707)
-
Iron-based web API has been replaced by the new implementation based onactix-web. (#727)Migration path:
For backend:
- Remove old dependencies on
ironand its companionsbodyparser,routerand others. - Simplify the API handlers as follows:
where
fn my_handler(state: &ServiceApiState, query: MyQueryType) -> Result<MyResponse, ApiError> { // ... }
MyQueryTypetype implementsDeserializetrait andMyResponseimplementsSerializetrait. - Replace old methods
public_api_handlerandprivate_api_handlerofServicetrait by a singlewire_apimethod which takesServiceApiBuilder. You can use this builder as a factory for your service API. get,get_errandpostmethods inTestKitApihave been replaced by the more convenientRequestBuilder. Don't forget to update your testkit-based API tests.
For frontend:
- New API implementation supports only query parameters in
GETrequests. In this way requests likeGET api/my_method/:first/:secondshould be replaced by theGET api/my_method?first=value1&second=value2. - JSON parser for
POSTrequests is now more strict. In this way you should sendnullin request body even for handlers without query parameters.
See our examples for more details.
- Remove old dependencies on
-
storage::base_indexmodule has become private along withBaseIndexandBaseIndexItertypes. (#723) -
ServiceFactorytrait has been extended withservice_namefunction. (#730) -
Method
namehas been removed fromRun,GenerateCommonConfig,GenerateNodeConfig,Finalize,GenerateTestnetandMaintenancestructures (helpers/fabricmodule). (#731) -
Whitelisthas been replaced byConnectList. Now connection between nodes can only be established if nodes exist in each other's connect lists. (#739)Migration path:
- Replace
[whitelist]section in config with[connect_list.peers]section and specify here all validators' consensus public keys with corresponding ip-addresses. For example16ef83ca...da72 = "127.0.0.1:6333".
- Replace
-
Healthcheck and consensus endpoints (
v1/healthcheckandv1/consensus_status) have been merged tov1/healthcheck. (#736, #766) -
Node configuration file is now updated at
ConnectListupdate. This is achieved via newConfigManagerentity. (#777)Migration path (required only if you create
Nodemanually):If you need to update
ConnectListon file system, passSome(path_to_node_config)as the last argument of theNode::newmethod. Otherwise, passNone. -
exonum::cryptotypes now have truncatedDisplay/Debugrepresentations. (#797)Migration path:
Use
encoding::serialize::ToHexinstead ofDisplayto produce full hexadecimal representation. You have to manually check if you need to switch or can keep using the truncated representation.Use
encoding::serialize::FromHexinstead ofFromStrfor reverse conversion.FromStrimplementation has been removed from crypto types to avoid errors.
New Features
exonum
-
Existing sodiumoxide-based cryptographic backend behind opt-out sodiumoxide-crypto feature. It also allows to use your own cryptographic library with exonum. (#756)
-
New kind of CLI commands has been added:
infocommand that can be used for getting various information from a node that has not been started yet. (#731)
Currently supported sub-commands:core-version- prints Exonum version as a plain string.list-services- prints the list of the services the node is built with in
the JSON format.
-
exonum::crypto::x25519module to convert keys from Ed25519 to X25519 format has been introduced. (#722) -
storage::Entryhas been extended withtakeandswapmethods. (#781)
Bug Fixes
exonum
-
Fixed bug with incorrect peer status for a turned-off node. (#730)
-
handle_consensusdoes not write warning for message from previous height any more. (#729) -
new_in_familyconstructor has been added to theEntryindex. (#790) -
Added missing
external_addressfield to the auditor final configuration. (#805)
Internal Improvements
BlockResponsesends transactions byHashinstead ofRawMessage. If the node does not have some transactions, requests are created for the corresponding transactions. Due to these changes, the block size became significantly smaller. (#664)
Exonum 0.8.1
New features
exonum
-
RunDevstructure has been made public, so it can be extended now. -
RunDevcommand now generates default values for api addresses in the config.
Internal improvements
exonum
- Dependencies versions have been updated:
exonum_sodiumoxideto0.0.19.exonum_rocksdbto0.7.4.
Exonum 0.8 "Great Grey Owl"
Breaking changes
exonum
-
handle_commitmethod inServicetrait has been renamed toafter_commit. (#715) -
TimeoutAdjusterConfighas been removed along with different timeout adjusters. Current behavior is similar to theDynamictimeout adjuster and can be modified throughmin_propose_timeout,max_propose_timeoutandpropose_timeout_thresholdfields in theConsensusConfig. (#643)Migration path:
Constanttimeout adjuster can be emulated by setting equalmin_propose_timeoutandmax_propose_timeoutvalues.- For
Dynamictimeout adjuster simply movemin,maxandthresholdvalues intomin_propose_timeout,max_propose_timeoutandpropose_timeout_thresholdcorrespondingly. - There is no possibility to emulate
MovingAveragenow, soDynamicshould be used as the closest alternative.
-
Network connections are now encrypted using Noise Protocol. Nodes compiled with old version will not connect to the new ones. Therefore you need to update all node instances for the network to work. (#678)
-
storage::Errorconstructor has been made private. (#689) -
ConsensusConfig::validate_configurationmethod has been renamed to thewarn_if_nonoptimal. (#690)
New features
exonum
-
Private API now support CORS. (#675)
-
The
--public-allow-originand--private-allow-originparameters have been added to thefinalizecommand. (#675) -
IPv6 addressing is now supported. (#615)
-
Field,CryptoHash,StorageValueandExonumJsontraits have been implemented forchrono::Durationstructure. (#653) -
before_commitmethod has been added inServicetrait. (#667) (#715) -
Field,CryptoHash,StorageKey,StorageValueandExonumJsontraits have been implemented forrust_decimal::Decimal. (#671) -
Maintenance CLI command for node management has been added. Currently the only supported command is
clear-cachewhich clears node message cache. (#676) -
StoredConfigurationvalidation has been extended withtxs_block_limitparameter check. (#690) -
A warning for non-optimal
StoredConfiguration::txs_block_limitvalue has been added. (#690) -
Private api
/v1/network/endpoint now returns core version in addition to service info. (#701)
exonum-timestamping
- Additional service example has been added along with frontend. (#646)
exonum-cryptocurrency-advanced
- Advanced cryptocurrency example becomes a public library (is published on crates.io). (#709)
Bug fixes
exonum
-
Already processed transactions are rejected now in
NodeHandler::handle_incoming_txmethod. (#642) -
Fixed bug with shutdown requests handling. (#666)
-
Fixed deserialization of the
MapProofdata structure. (#674) -
Fixed a bug which prevented the node from reaching the actual round. (#680 #681)
exonum-configuration
- Error description has been added to the return value of the transactions. (#695)
exonum-time
- Error description has been added to the return value of the transactions. (#695)
exonum-cryptocurrency-advanced
Internal improvements
exonum
-
Default implementation of
checkmethod was added toFieldtrait to reduce boilerplate. (#639) -
Metrics are now using
chrono::DateTime<Utc>instead ofSystemTime. (#620)
exonum-time
- Split service components to separate modules. (#604)
exonum-configuration
- Method
ProposeData::set_history_hashhas been removed. (#604)
Exonum 0.7.1
Exonum 0.6.1
Exonum 0.7 "Fulvous Owl"
Breaking changes
exonum
-
POST-requests are now handled with
bodyparsercrate, so all the parameters must be passed in the body. (#529) -
ProofListIndexandProofMapIndexroot_hashmethod has been renamed tomerkle_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.MapProofinterface 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_indexmodule for theoretical details about the new proof structure.
- Consult documents for the updated workflow for creation and verification of
-
with_prefixconstructor of all index types has been renamed tonew_in_family. Now it usesindex_idinstead of prefixes. Moreover,blockchain::gen_prefixmethod has been removed. Instead, any type that implementsStorageKeytrait, can serve as anindex_id. (#531) -
Several
Schema's methods have been renamed (#565):tx_location_by_tx_hashtotransactions_locations.block_txstoblock_transactions.
-
SystemTimepreviously used as storage key or value turned out to show different behavior on different platforms and, hence, has been replaced withchrono::DateTime<Utc>that behaves the same in any environment. (#557)Migration path:
- Replace all
SystemTimefields withchrono::DateTime<Utc>ones. - Use
DateTime::fromandinto()methods to convert your existingSystemTimeinstances into suitable type when constructing transactions or working with database.
- Replace all
-
Blockchainmethodtx_from_raw()now returnsResult<Box<Transaction>, MessageError>instead ofOption<Box<Transaction>>. (#567) -
eventsmodule becomes private. (#568) -
CryptoHashtrait is no longer implemented forHash. (#578) -
network_idattribute has been removed fromNodeInfoandRawMessage.HEADER_LENGTHremains the same, first byte ofRawMessageis now reserved and always set to0. (#579) -
exonum::explorermodule 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_rangemethod. block_infoandtx_infomethods of the explorer are renamed toblockandtransactionrespectively.TransactionInfomoved from theapi::publicmodule to theexplorermodule.BlocksRangemoved from theexplorermodule to theapi::publicmodule.TxInfois renamed toCommittedTransaction.BlockInfofields are private now, yet accessible with getter methods.
Migration path:
- Rename imported types and methods as specified above
- Use explicit type parameter in
TransactionInfoandCommittedTransaction(e.g.,TransactionInfo<serde_json::Value>orTransactionInfo<MyTransaction>) if you need to deserialize transaction-related data returned from the explorer HTTP API. - Consult
explorermodule docs for further possible changes in API.
- The explorer now allows to iterate over blocks in the blockchain in the given height range, replacing old
-
validators-countcommand-line parameter has been added. Now, when generating config template usinggenerate-templatecommand, you must specify the number of validators. (#586) -
majority_countparameter has been added to theStoredConfiguration. Seeexonum-configurationchanges for more details. (#546)
exonum-testkit
-
Rollback mechanism in
Testkitis reworked to work with checkpoints (#582):- old
rollbackby blocks inTestkitwas removed; checkpointmethod was introduced to set checkpoints;- new
rollbackrolls back to the last set checkpoint.
Migration path:
- Replace every old
rollback(blocks)by a pair ofcheckpoint()androllback().
- old
-
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 useis_tx_in_pooloradd_txmethods.
-
TestKitApi::get_errmethod now returnsApiError, rather than a deserialized object, as it is forget. For checking such results in tests you may want to useassert_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
SystemTimehas been replaced withchrono::DateTime<Utc>, as it provides more predictable behavior on all systems. (#557)
New features
exonum
-
ExecutionError::with_descriptionmethod now takesInto<String>instead ofStringwhich allows to pass&strdirectly. (#592) -
New
databasefield added to theNodeConfig. This optional setting adjusts database-specific settings, like number of simultaneously opened files. (#538) -
Added
v1/user_agentendpoint with information about Exonum, Rust and OS versions. (#548) -
ProofMapIndexnow allows to retrieve a proof of presence / absence for an arbitrary number of elements at one time with the help ofget_multiproofmethod. Correspondingly,MapProofallows to verify proofs for an arbitrary number of elements. (#380) -
storage::UniqueHashtrait 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,StorageKeyandStorageValuetraits are implemented for theuuid::Uuid. (#588) -
Displaytrait is implemented for types from thecryptomodule. (#590) -
transactions!macro now allows empty body. (#593)
exonum-testkit
-
create_block*methods of theTestKitnow 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
-
RawTransactionnow has its own implementation offmt::Debugtrait instead of#[derive(Debug)]. The template ofRawTransaction’s debug message isTransaction { 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
TransactionsRequestare 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
TestKitApinow encompasses all requests. The log format is slightly changed to allow for the generic request / response form. (#601)
Exonum 0.6 "Elf Owl"
Breaking changes
exonum
-
exonum::crypto::CryptoHashtrait is introduced, andStorageValue::hashandMessage::hashmethods are removed. (#442)Migration path:
- For implementations of
StorageValue, move thehashmethod toCryptoHashimplementation instead. - For implementations of
Messagesimply removehashmethod, there's a blanket impl ofCryptoHashforMessage. - Add
use exonum::crypto::CryptoHashto use thehashmethod.
- For implementations of
-
The
StorageKeytrait is re-implemented for signed integer types (i8,i16,i32andi64) to achieve the natural ordering of produced keys. (#443)This change will break indices using signed integers as keys. To emulate the old implementation, you may create a wrapper around a type (e.g.,
struct QuirkyI32Key(i32)) and implementStorageKeyfor it using big endian encoding. Then, use the wrapper instead of the int type in indices. See the unit tests forStorageKeyfor an example. -
Transaction::executemethod now returnsTransactionResultthat is stored in the blockchain and can be accessed through api. The changes made by transactions that returnErrare discarded. To migrate, addOk(())as the last line to theexecutemethod. More generally, make sure that the method returnsOk(())on successful execution. (#385) -
Service transactions are now defined through
transactions!macro that automatically assigns transaction IDs based on the declaration order. (#457)Migration path:
- Move all separate transactions declared as
message!into onetransactions!macro. - Remove
IDconstants. - Replace
TYPEconstants with a singleSERVICE_IDconstant.
- Move all separate transactions declared as
-
Several variants were removed from
ApiErrorenum. (#474)Migration path:
- Use generic
ApiError::BadRequestvariant or createIronErrordirectly.
- Use generic
-
CommandExtensionusesfailure::Errorinstead ofBox<std::error::Error>for errors. (#474)Migration path:
std::error::Errorcan be converted tofailure::Errorvia.into()method.
-
storage::Errorimplementsfailure::Failinstead ofstd::error::Error. (#474) -
CryptoHashfor()now correctly calculates a hash of an empty byte array instead of returningHash::zero(). (#483) -
Removed the
'staticbound from the return value of theblockchain::Service::service_name()method. (#485) -
StorageKeytrait now requiresToOwnedimplementation. (#392) -
Connectmessage has been extended with a user agent string, which breaks binary compatibility with previous versions. (#362) -
Log output become more human-readable. Now it uses
rfc2822for time formatting. This change can break scripts that analyze the log output. (#514) -
output_dirargument of thegenerate-testnetcommand has been renamed tooutput-dir. (#528) -
peer_addrargument of thegenerate-configcommand has been renamed topeer-address. (#528) -
Blockchain::newandNode::newnow acceptInto<Arc<Database>>instead ofBox<Database>. (#530)Migration path:
- Just pass database argument as is, for example instead of
Box::new(MemoryDb::new())useMemoryDb::new().
- Just pass database argument as is, for example instead of
exonum-configuration
-
Most types renamed to avoid stuttering (see here for an explanation of the term) (#496):
ConfigurationServicetoServiceConfigurationServiceFactorytoServiceFactoryTxConfigProposetoProposeTxConfigVotetoVoteConfigurationSchematoSchemaStorageValueConfigProposeDatatoProposeDataCONFIG_SERVICEconstant toSERVICE_ID
Check the crate documentation for more details.
Migration path: Rename imported types from the crate, using aliases or qualified names if necessary:
use exonum_configuration::Service as ConfigService.
-
Multiple APIs are no longer public (#496):
- Message identifiers
- Mutating methods of the service schema
- Module implementing HTTP API of the service
Check the crate documentation for more details.
Migration path: The restrictions are security-based and should not influence intended service use.
ZEROVOTEis replaced with theMaybeVotetype, which is now used instead ofVotein the schema method signatures. The storage format itself is unchanged (#496).
exonum-time
-
The structure
Timeis removed, useSystemTimefor saving validators time inProofMapIndexinstead. (#20) -
Renamed methods
validators_time/validators_time_muttovalidators_times/validators_times_mutinSchema. (#20)
New features
exonum
-
StorageKeyandStorageValuetraits are implemented forSystemTime. (#456) -
StorageValueandCryptoHashtraits are implemented forbool. (#385) -
Heightimplementsstd::str::FromStr. (#474) -
v1/transactionsendpoint has been extended with the transaction execution status. (#488) -
Key-indexes interface now allows to use borrowed types for the search operations. (#392)
-
Added
v1/shutdownendpoint for graceful node termination. (#526) -
TransactionInfofrom the public api module became public. (#537)
exonum-testkit
-
Modified signature of the
TestKitApi::sendmethod, which previously did not acceptBox<Transaction>. (#505) -
Added possibility to init a logger in
TestKitBuilder. (#524)
exonum-configuration
-
Information about configurations by
/v1/configs/actual,/v1/configs/followingand/v1/configs/committedendpoints is extended with the hash of the corresponding proposal and votes for the proposal (#481). -
Implemented error handling based on error codes (#496).
Bug fixes
exonum
-
ExonumJsonDeserializetrait is implemented forF32andF64. (#461) -
Added round and propose timeouts validation. (#523)
-
Fixed bug with the extra creation of the genesis configuration. (#527)
-
Fixed panic "can't cancel routine" during node shutdown. (#530)
Internal improvements
exonum
Exonum 0.5.1
Bug fixes
- Fixed logger output. (#451)
Exonum 0.5 "Dusky Eagle-Owl"
Breaking changes
- The order of bytes and bits in the
DBKeykeys ofProofMapIndexbecame consistent. The change influences how Merkle Patricia trees are built forProofMapIndex: the bits in each byte of aDBKeyare now enumerated from the least significant bit (LSB) to the most significant bit (MSB), compared to MSB-to-LSB ordering used before. Note: this change will break old storages using map proofs. (#419) - The
Databasetrait is simplified: it is no longer required to implement state-sharingclonemethod. Instead, themergemethod now takes a shared reference toself. (#422) message!andencoding_struct!no longer require manualSIZEand offset specification. (#413)from_raw(raw: RawMessage)method is moved to theMessagetrait. To migrate, adduse exonum::messages::Message. (#427)- Changed iterators over
PatchandChangesdata into custom types instead of standard collection iterators. (#393) - Fixed typo in
SparceListIndexKeysandSparceListIndexValues. (#398) - Removed default
state_hashimplementation in theServicetrait. (#399) - Removed
infomethod from theTransaction. (#402) - Replaced config param
timeout_events_capacitywithinternal_events_capacity. (#388) - The
Transactiontrait now inherits fromExonumJson. (#402) - Renamed
DBKeytoProofPathand moved a part of its functionality to theBitsRangetrait. (#420)
New features
- Added
patchmethod to theForkstructure. (#393) - Added a public
healthcheckendpoint. (#405) - Added serialization support of floating point types through special wrapper (
F32andF64). This feature is hidden behindfloat_serializegate. Note: special values (Infinity and NaN) aren't supported. (#384) - Added a possibility to set maximum message size (
pub max_message_lenfield inConsensusConfig). (#426) - Added support for CORS. (#406)
- Added
run-devcommand that performs a simplified node launch for testing purposes. (#423)
Bug fixes
- Fixed consensus on the threshold of 1/3 sleeping validators. (#388)
- Fixed a bunch of inconsistencies and mistakes in the docs. (#439)
- Fixed a bug with message header validation. (#430)
Internal improvements
Exonum 0.4 "Chestnut Owlet"
Added
- Allow creating auditor node from command line. (#364)
- Added a new function
merge_sync. In this function a write will be flushed from the operating system buffer cache before the write is considered complete. (#368) - Added conversion into boxed values for values which implement
ServiceorTransactiontraits. (#366) - Added constructor for the
ServiceContextwhich can be useful for the alternative node implementations. (#366) - Implemented
AsRef<RawMessage>for any Exonum messages that were created using themessage!macro. (#372) - Implemented additional checks for conversion from raw message. (#372)
Changed
- Changed a signature of
openfunction in arocksdbmodule.RocksDBOptionsshould pass by the reference. (#369) ValidatorStatein theServiceContextreplaced by theValidatorId. (#366)add_transactionin theServiceContextreplaced by thetransaction_senderwhich implements theTransactionSendtrait. (#366)- The
Nodeconstructor now requiresdbandservicesvariables instead ofblockchaininstance. (#366) - The
Blockchainconstructor now requires services keypair and anApiSenderinstance. (#366) mount_*_apimethods inBlockchaininstance now do not requireApiContext. (#366)- Rename method
last_heighttoheightinSchema. (#379) last_blocknow returnsBlockinstead ofOption<Block>. (#379)- Replaced
rocksdbcommandline parameter to more genericdb-path. (#376) - Obsolete trait
HexValuereplaced by theFromHexandToHextraits. (#372) - Changed
PatchandChangesfrom typedefs into opaque structures. (#371) - Help text is displayed if required argument is not specified. (#390)
Removed
- Removed
roundmethod from theServiceContext. (#366) - Removed redundant
FromRawtrait. (#372) - Removed redundant
current_heightmethod inSchema. (#379)