Skip to content

Libplanet 0.5.0

Compare
Choose a tag to compare
@github-actions github-actions released this 22 Aug 10:32
· 8631 commits to main since this release
1e448de

Released on August 22, 2019.

Backward-incompatible interface changes

  • Added IStore.GetBlockIndex() method. [#385]
  • StoreExtension.LookupStateReference<T>() method became to return Tuple<HashDigest<SHA256>, long> which is a nullable tuple of Block<T>.Hash and Block<T>.Index. [#350]
  • Added IBlockPolicy<T>.BlockAction property. [#319, #367]
  • Removed the type parameter of ActionEvaluation. [#319, #367]
  • ActionEvaluation.Action became to IAction type. [#319, #367]
  • LiteDBStore() constructor became to have a new option named flush and turned on by default. [#387, LiteDB #1268]
  • LiteDBStore() constructor became to have a new option named readOnly and turned off by default. [#434]
  • BaseIndex.ContainsKey() method became abstract. [#390]
  • BlockDownloadState.TotalBlockCount and BlockDownloadState.ReceivedBlockCount became to Int64 type. [#396, #399]
  • IStore.IterateIndex() method became to receive offset and limit parameters. [[#425]]
  • Added IStore.GetCanonicalNamespace() method. [#426]
  • Added IStore.SetCanonicalNamespace() method. [#426]
  • Removed IRandom.NextDouble() method, because floating-point arithmetics, which is underspecified, likely introduce indeterminism. [#410, #419]
  • Added IActionContext.NewGuId() method. [#371, #439]
  • Address(byte[]) became to throw ArgumentNullException instead of NullReferenceException. [#443]
  • Removed FileStore class. [#446]

Added interfaces

  • Added trustedStateValidators option to Swarm<T>.PreloadAsync() method. If any peer in this set is reachable and there is no built up blockchain in a current node, Swarm<T> receives the latest states of the major blockchain from that trusted peer, which is also calculated by that peer, instead of autonomously calculating the states from scratch. Note that this option is intended to be exposed to end users through a feasible user interface so that they can decide whom to trust for themselves. [#272, #343]
  • Added StoreExtension.ListAllStateReferences(this IStore, string, HashDigest<SHA256>?, HashDigest<SHA256>?) extension method. [#363, #384, #385]
  • Address class became to implement IComparable<Address> and IComparable interfaces. [#363]
  • Added BlockChain<T>.BlockHashes property. [#389]
  • Swarm<T>.PreloadAsync(IProgress<PreloadState>, IImmutableSet<Address>, CancellationToken) became to report progress for all phases. [#397, #400]
  • Added PreloadState, ActionExecutionState, StateReferenceDownloadState, and BlockStateDownloadState classes to cover all phases in the entire preloading process. [#397, #400]
  • Added Address(ImmutableArray<byte>) constructor. [#442, #443]

Behavioral changes

  • BlockChain<T>.PreloadAsync() method became to omit rendering of IActions in the preloaded behind blocks. [#272, #343]
  • Swarm<T> became to have two more message types: GetRecentStates (0x0b) and RecentStates (0x0c). [#272, #343]
  • BlockChain<T>.MineBlock() and BlockChain<T>.GetNextTxNonce() methods became to ignore transactions that didn't follow Transaction<T>.Nonce sequentially and treat them as pendings. [#365]
  • BlockChain<T> became to evaluate IBlockPolicy<T>.BlockAction and set the state when a block is appended to the chain. [#319, #367]
  • BlockSet<T>.ContainsKey() and TransactionSet<T>.ContainsKey() methods became O(1) time complexity through omitting iteration and relying own retrieve implementations. [#390]
  • The way LiteDBStore stores state references became efficient, but the file-level backward compatibility was also broken. [#395, #398]
  • Swarm<T>.PreloadAsync() method became to report a block downloading progress with the total number of blocks to download in the entire batch, instead of the window size of a chunk (i.e., 500). [#396, #399]
  • Swarm<T>.PreloadAsync() became to get the first parameter, progress, which accepts IProgress<PreloadState>. [#397, #400]
  • BlockHashes messages became to contain one more higher hash. [#408, #445]
  • Swarm<T>.PreloadAsync() became safe from data corruption even if a preloading process suddenly gets shutdown. [#417]
  • FileStore and LiteDBStore became to guarantee atomicity of storing transactions. [#413]
  • IStore.PutTransaction<T>() became to do nothing when it takes the Transaction<T> more than once. [#413]
  • BlockChain<T>.Swap() became to omit common block finding when render is false. [#423]
  • PrivateKey(byte[]) constructor became to check validity. [#438]

Bug fixes

  • Fixed a bug where the LiteDBStore.IterateStagedTransactionIds() returns duplicated transaction ids. [#366]
  • Fixed a bug that NullReferenceException occurred when serializing default Address. [#369]
  • Removed unnecessary mutex in Swarm<T> to avoid continuous delays in peer registration in some situations. [#375]
  • Fixed a bug that TurnClient had thrown KeyNotFoundException and IOException on startup. [#377, #378]
  • Fixed a LiteDBStore bug that blocks or transactions had got corrupted sometimes. Instead, LiteDBStore.GetTransaction() became possible to return null even for already stored transactions, and for that case, a warning will be logged through Serilog. [#386, #387, LiteDB #1268]
  • Fixed a bug that NetworkStreamProxy.StartAsync() hadn't stopped properly when the connection had reset by a remote peer. [#414]
  • Fixed a bug that Swarm<T> had hung forever after a remote peer had disconnected while receiving. [#416]
  • Fixed a bug that Swarm<T>.PreloadAsync() had been processed even if there is no appropriate peer. [#418]
  • Fixed a bug that TURN-related tasks hadn't restarted automatically when an exception occurred. [#422]
  • Fixed a bug that TURN relay connection had disconnected when preloading took a long time. [#424]