Skip to content

Libplanet 0.3.0

Compare
Choose a tag to compare
@dahlia dahlia released this 31 May 08:40
d2f0126

Released on May 31, 2019.

Backward-incompatible interface changes

  • Added IAction.Render(IActionContext, IAccountStateDelta) method. [#31, #212]
  • Added IAction.Unrender(IActionContext, IAccountStateDelta) method. [#31, #212]
  • BlockChain<T>.Validate() method became to receive
    IReadOnlyList<Block<<T>> instead of IEnumerable<Block<T>>. [#205]
  • IBlockPolicy<T>.GetNextBlockDifficulty() method became to receive IReadOnlyList<Block<<T>> instead of IEnumerable<Block<T>>. [#205]
  • Added IBlockPolicy<T>.ValidateNextBlock(IReadOnlyList<Block<T>>, Block<T>) method. [#210]
  • Removed IBlockPolicy<T>.ValidateBlocks() method. [#210]
  • BlockChain<T>[int] became to throw ArgumentOutOfRangeException instead of IndexOutOfRangeException. [#210]
  • Removed KeyEquals() methods from all classes and structs. [#216]
  • Swarm class now does not implement IEquatable<Swarm> anymore and its Equals(object) method and GetHashCode() method became to have default behavior of object class. [#216]
  • Also, Swarm class now does not implement IDisposable too. Thus Swarm.Dispose() was removed too. [#218]
  • Swarm became to use a queue to maintain internal messages. [#218]
    • The broadcasting methods are no more async, so they are renamed as below.
      • Swarm.BroadcastBlocksAsync()Swarm.BroadcastBlocks()
      • Swarm.BroadcastTxsAsync()Swarm.BroadcastTxs()
  • The type of Block<T>.Difficulty is changed to long instead of int, and related classes method parameters and field types have changed accordingly.
  • Removed HashDigest.HasLeadingZeroBits() method. [#213]
  • The signature of IStore.PutBlock<T>(Block<T>) method was changed to PutBlock<T>(Block<T>, Address). [[#189], #197]
  • Block<T>.Hash is no longer calculated using the full data of the Transaction<T>, but is calculated using only the Transaction<T>.Id. [#234]
  • Added IStore.LookupStateReference<T>(string, Address, Block<T>) method. [#232]
  • Added IStore.StoreStateReference<T>(string, Block<T>) method. [#232]
  • Added IStore.ForkStateReferences<T>(string, string, Block<T>, IImmutableSet<Address> method. [#232]
  • Removed Block<T>.Validate() and Block<T>.EvaluateActions() method. [#243]
  • Added Transaction<T>.Nonce and RawTransaction.Nonce properties. [#246]
  • Added IStore.GetTxNonce(string, Address) method. [#246]
  • Added IStore.IncreaseTxNonce<T>(string, Block<T>) method. [#246]
  • Added IStore.ForkTxNonce<T>(string, string, Block<T>, IImmutableSet<Address> method. [#246]

Added interfaces

  • BlockChain<T> became to implement IReadOnlyList<Block<T>>. [#205]
  • Added Swarm.DifferentVersionPeerEncountered event handler that can handle events when a different version of a peer is discovered. [[#167]], [#185]
  • Added Peer.AppProtocolVersion property. [#185]
  • Added Swarm.PreloadAsync() method to explicitly and preemptively download initial blocks before Swarm.StartAsync<T>() being called. [#204], [#206]
  • Added BlockDownloadState class to represent a block downloading state. [#204], [#206]
  • Added BlockPolicyExtension.ValidateBlocks<T>(IBlockPolicy<T>, IReadOnlyList<Block<T>>, DateTimeOffset) method. [#210]
  • Added Transaction<T>.EvaluateActionsGradually(HashDigest<SHA256>, long, IAccountStateDelta, Address, bool) method. [#31, #212]
  • Added Block<T>.EvaluateActionsPerTx(AccountStateGetter) method. [#31, #212]
  • Added HashDigest.Satisfies() method. [#213]
  • BlockPolicy<T> constructor became to receive the minimumDifficulty and the mining difficultyBoundDivisor. [#213]
  • Added BlockChain<T>.UnstageTransactions() method. [#223]
  • Swarm constructor became to receive a linger (or millisecondsLinger) parameter. This purposes to determine how long to wait for pending messages when a Swarm instance is requested to terminate.
  • Added NamespaceNotFoundException class. [#232]
  • Added Block<T>.Evaluate() method. [#243]
  • Made InvalidBlockTimestampException class public so that it can be caught. [#133, #251]
  • Added InvalidTxNonceException class. [#246]

Behavioral changes

  • Swarm.StartAsync() now receives the height of blocks (tip Index) from other known peers and synchronizes the blocks if necessary before propagating/receiving pinpointed recent blocks to prevent inefficient round-trips. [#187, #190]
  • The calculation algorithm of BlockPolicy<T>.GetNextBlockDifficulty() method was changed to the Ethereum Homestead algorithm except for the difficulty bomb. [#213]
  • The difficulty was changed from representing the number of leading zeros of target number to representing a divisor to obtain the target number. [#213]
  • BlockSet<T>[int] changed so as not to validate a block. [#231]
  • Improved read performance of Block<T>.Hash and Transaction<T>.Id. [#228, #234]
  • Swarm.StartAsync() now does not call Swarm.StopAsync() anymore, therefore Swarm.StopAsync() should be explicitly called. [#236]
  • Transaction<T>.EvaluateActionsGradually() became to record IAccountStateDelta.SetState() calls even if its argument is the same to the previous state. [#241]
  • Block<T>.Validate() and Block<T>.EvaluateActions() are integrated into Block<T>.Evaluate(). [#243]
  • BlockChain<T>.Append() became to execute Action.Execute() only once per action in the Block<T>. [#243]
  • BlockChain<T>.Append() method became to throw InvalidTxNonceException when the Transaction<T>.Nonce does not correspond to its Signer's current nonce. [#246]
  • Swarm became to enforce ForceDotNet.Force() in AsyncIO while it's running on Mono runtime. [#247]

Bug fixes

  • Fixed a bug that TURN relay had been disconnected when being connected for longer than 5 minutes. [#198]
  • Fixed a bug that Swarm had attempted to use TURN relay even if the host argument was given. [#198]
  • Improved the read throughput of BlockChain<T>.Append().
  • Improved overall read throughput of BlockChain<T> while blocks are being mined by BlockChain<T>.MineBlock(). [#191]
  • Fixed a bug that TurnClientException had been thrown by Swarm when a STUN nonce is stale. [#193]
  • Fixed BlockChain<T>.GetStates() had descended to the bottom (i.e., the genesis block) where a given Address refers to a nonexistent account (i.e., never used before). [[#189], #192]
  • Fixed a bug that a TURN connection had turned unavailable after it once failed to parse a message (due to a corrupted packet). [#215]
  • Instead of validating the entire blocks, BlockChain<T>.Append() method became to validate only the next block to be appended. [#210]
  • Improved BlockChain<T>.Fork() performance by avoiding double validation of already validated blocks. [#215]
  • Removed unnecessary writer locks on BlockChain<T>.StageTransactions(). [#217]
  • Improved concurrency of BlockChain<T>.Append() method by removing unnecessary race conditions. [#217]
  • Fixed a bug that Swarm could not properly communicate with Peer behind NAT. [#240]
  • Fixed a bug that BlockChain<T>.FindNextHashes() throws ArgumentOutOfRangeException when chain is empty.
  • Fixed a bug that TurnClient.AcceptRelayedStreamAsync()didn't handle concurrent connections correctly. [#256]