Skip to content

Libplanet 0.8.0

Compare
Choose a tag to compare
@github-actions github-actions released this 04 Feb 06:41
· 7869 commits to main since this release
836f40b

Released on February 4, 2020.

Backward-incompatible API changes

  • The internal representation for state keys became string (was Address). [#368, #774]
    • The return type of IStore.GetBlockStates() method became IImmutableDictionary<string, IValue> (was AddressStateMap, which was removed too). [#368, #774]
    • The type of the second parameter of IStore.SetBlockStates() method became IImmutableDictionary<string, IValue> (was AddressStateMap, which was removed too). [#368, #774]
    • The second parameter of IStore.IterateStateReferences() method became string key (was Address address). [#368, #774]
    • The second parameter of IStore.StoreStateReference() method became IImmutableSet<string> keys (was IImmutableSet<Address> addresses). [#368, #774]
    • IStore.ListAddresses() method was replaced by IStore.ListStateKeys() method. [#368, #774]
  • Added Swarm<T>.FindSpecificPeer() method to find a specific peer given the address. [#570, #580]
  • Removed LiteDBStore class. Use DefaultStore instead. [#662]
  • Removed BlockChain<T>.Contains(TxId) method. Use IStore.ContainsTransaction(TxId) instead. [#676]
  • Renamed BlockChain<T>.Contains(HashDigest<SHA256>) method to BlockChain<T>.ContainsBlock(HashDigest<SHA256>). [#678]
  • Removed BlockChain<T>.Contains(Block<T>) method. [#678]
  • Changed semantics of BlockChain<T>.ContainsBlock(HashDigest<SHA256>) method and BlockChain<T>[HashDigest<SHA256>] indexer as lookups only the current chain, not entire storage. [#678]
  • Added IStore.ContainsBlock(HashDigest<SHA256>) method. [#678]
  • Removed AddressStateMap class. [#98, #368, #692, #774]
    • The return type of BlockChain<T>.GetState() method became IValue (was AddressStateMap).
    • The return type of IStore.GetBlockStates() method became IImmutableDictionary<string, IValue> (was AddressStateMap).
    • IStore.SetBlockStates() method became to take IImmutableDictionary<string, IValue> instead of AddressStateMap.
  • Swarm<T>.PreloadAsync() method and Swarm<T>.StartAsync() method became to take preloadBlockDownloadFailed event handler as an argument. [#694]
  • Added the genesisBlock parameter to BlockChain<T>() constructor. [#688]
  • Removed StateReferenceDownloadState class. [#703]
  • Removed BlockStateDownloadState class. [#703]
  • Removed TxReceived and BlockReceived AsyncAutoResetEvents from Swarm<T>. [#705, #725]
  • Added workers optional parameter into Swarm<T>() constructor. [#613, #727]
  • Block<T> class became not to implement ISerializable. [#751]
  • Transaction<T> class became not to implement ISerializable. [#751]
  • Block<T>.ToBencodex() became to return Bencodex.Types.Dictionary. [#751]
  • Transaction<T>.ToBencodex() became to return Bencodex.Types.Dictionary. [#751]
  • Removed Block<T>.FromBencodex(byte[]) method. [#751]
  • Removed Transaction<T>.FromBencodex(byte[]) method. [#751]
  • Block<T>.ToBencodex() became to take no arguments. [#749, #757]
  • Removed Swarm<T>.BroadcastBlocks(IEnumerable<Block<T>>) method. [#764]
  • StoreExtension.LookupStateReference<T>() method was replaced by IStore.LookupStateReference<T>() method. [#722, #774]

Backward-incompatible network protocol changes

  • Added long-typed offset parameter to RecentStates and GetRecentStates messages. [#703]
  • Added int-typed iteration parameter to RecentStates message. [#703]
  • Added BlockHeaderMessage message. [#764]

Backward-incompatible storage format changes

  • The introduced DefaultStore is incompatible at the file-level with the LiteDBStore which had existed. DefaultStore became to take a directory instead of a single file, and it consists of multiple subdirectories and a LiteDB file for indices. [#662, #680]

Added APIs

  • Added DefaultStore class to replace LiteDBStore. [#662]
  • Added IStore.ListAllStateReferences<T>() method. [#701, #703]
  • Added IStore.ListStateKeys() method to replace IStore.ListAddresses() method. [#368, #774]
  • Added IStore.LookupStateReference<T>() method to replace StoreExtension.LookupStateReference<T>() method. [#368, #722, #774]
  • Added BlockChain<T>.Genesis property. [#688]
  • Added BlockChain<T>.MakeGenesisBlock() static method. [#688]
  • Added InvalidGenesisBlockException class. [#688]
  • Added StateDownloadState class which reports state preloading iteration progress. [#703]
  • Added PeerDiscoveryException class which inherits SwarmException class. [#604, #726]
  • Added Swarm<T>.Peers property which returns an enumerable of peers in Swarm<T>'s routing table. [#739]
  • Added Block<T>.Serialize() method which returns byte[]. [#751]
  • Added Transaction<T>.Serialize() method which returns byte[]. [#751]
  • Added Block<T>(Bencodex.Types.Dictionary) constructor. [#751]
  • Added Transaction<T>(Bencodex.Types.Dictionary) constructor. [#751]
  • Added Block<T>.Deserialize(byte[]) method. [#751]
  • Added Transaction<T>.Deserialize(byte[]) method. [#751]
  • Added StoreExtension.Copy(this IStore, IStore) extension method. [#753]
  • Added a HashDigest<SHA256>?-typed TxHash property which digests all transactions in the block to Block<T> class. [#749, #757]
  • Added CryptoConfig class. [#758]
  • Added ICryptoBackend class. [#758]
  • Added DefaultCryptoBackend class. [#758]
  • Added Swarm<T>.BroadcastBlock(Block<T>) method. [#764]
  • Added Swarm<T>.PeerStates property. [#772]
  • Added PeerState class which represents a Peers state in the routing table. [#772]
  • Added Swarm<T>.CheckAllPeersAsync() method. [#772]

Behavioral changes

  • Swarm<T> became to compare only peer's addresses instead of public keys to determine if a peer is in routing table or not. [#665]
  • When Swarm<T>.PreloadAsync() method fails to download blocks, Swarm<T> became to call preloadBlockDownloadFailed event handler taken as an argument. If the event handler is not present, Swarm<T> throws SwarmException. [#694]
  • Swarm<T>.PreloadAsync() became not to sync state references and block states at once. [#703]
  • Swarm<T> became to print less logs on debug level during sending states. [#706]
  • Increased Swarm<T>'s network timeout value, in order to be stable a high latency internet connection. [#709]
  • Swarm<T>.BootstrapAsync() became to report PeerDiscoveryException instead of SwarmException directly. [#604, #726]
  • BlockChain<T>.Append() became to unstage the staged Transaction<T>s that have lower nonce than the highest nonce of the same signer's transactions in the same chain, since these virtually never become valid. [#721, #728]
  • Swarm<T> became not to fill blocks if received block hashes are continuous. [#732]
  • Swarm<T> became to can process more requests at once by creating TURN relaying proxy concurrently. [#744]
  • Swarm<T> became to throw InvalidGenesisBlockException when receiving block from the nodes that have a different genesis block. [#746]
  • Swarm<T> became to distinguish the starting stages clearly. In other words, Swarm<T>.StartAsync() became not to call Swarm<T>.PreloadAsync(). [#735, #760]
  • The hash of Block<T> has changed due to the change in the method of serialization. [#762]
  • Swarm<T> became to ignore broadcasted block that has lower index than the current tip. [#764]
  • The way Swarm<T> chose peers to spread messages has changed. [#765, #767]
    • If there are less than 10 peers in the routing table, select all peers.
    • If there are more than 10 peers in the routing table, choose one from each bucket, and if the number is less than 10, then select an additional peers so that the total is 10.

Bug fixes

  • Fixed a bug where the canonical chain could be deleted if Swarm<T> failed to download blocks due to network connection. [#675]
  • Fixed bug that re-download block from scratch in preloading. [#685]
  • Fixed a bug where state references become outdated if a chain is forked and then adding existing blocks into it. [#704]
  • Fixed a bug where Swarm<T> had exhausted all available sockets. [#709]
  • Fixed a bug where Swarm<T> had infinitely repeated failed requests. [#709]
  • Fixed a bug where Swarm<T> hadn't stopped properly. [#709]
  • Fixed a bug where Swarm<T>.BootstrapAsync() had stopped due to trivial (recoverable) TimeoutExceptions. [#715, #716]
  • Fixed a bug where BlockChain<T>.GetNextTxNonce() had returned invalid tx nonce. [#718]
  • Fixed a bug where mined transactions were staged again. [#719]
  • Fixed a bug where Block<T>.Hash property, Block<T>.Mine() method, Block<T>.FromBencodex() method, Block<T>.ToBencodex() method, Transaction<T>.Id property, Transaction<T>.Signature property, Transaction<T>.Create() method, Transaction<T>.FromBencodex() method, and Transaction<T>.ToBencodex() method had been non-deterministic on some CultureInfo.CurrentCulture (e.g., ar_SA, fr_FR, th_TH) so that it had caused network protocol incompatibilities. [#734]
  • Fixed a bug where the states became empty between the tip of the peer to receive the states and the tip of the downloaded block. [#736]
  • Fixed a bug where Swarm<T>.StartAsync() had thrown NullReferenceException when host parameter is present on the outside of NAT. [#744]
  • Fixed a bug where Swarm<T> had failed to request a TURN relay when it has an IPv6 address. [#744]
  • Fixed a bug where DefaultStore had invalid state references cache after fork. [#759]
  • Fixed a bug where BlockChain<T> had rendered and evaluated actions in the genesis block during forking. [#763]
  • Fixed a Swam<T>'s bug that some Transaction<T>s had become excluded from mining Block<T>s after reorg from α to β where a Transaction<T> was once included by a Block<T> (α) and not included by an other Block<T> (β) for the same Index due to the latency gap between nodes. [#775]