Skip to content

@github-actions github-actions released this Nov 25, 2020 · 53 commits to main since this release

Released on November 25, 2020.

  • Fixed BlockChain<T>.Append() method's bug that it had accepted a Block<T> having more Transactions than the number specified by the IBlockPolicy<T>.MaxTransactionsPerBlock property. Now it throws InvalidBlockException instead for such case. [#1104]
Assets 21

@github-actions github-actions released this Nov 24, 2020 · 60 commits to main since this release

Released on November 24, 2020.

  • Transaction<T>.Id property became lazy-loaded and cached if it's once loaded. (It had been loaded when the object is instantiated.) [#1079, #1080]
  • The result bytes of Transaction<T>.Serialize() became cached under the hood. [[#1079, #1080]]
  • Fixed BlockChain<T>.MineBlock() method's bug which excludes one's all transactions virtually forever after a signer's transactions once have been staged without the ascending order of nonce (usually due to their inconsistent propagation latency on the network). [#1057, #1059]
  • BlockChain<T>.MineBlock() method became to cut off staged transactions to mine if it takes longer than 4 seconds to collect and validate them. Those rest staged transactions are postponed until next block mining. [#1057, #1059]
  • BlockChain<T>.ContainsBlock() method was optimized so that it does not needlessly load an entire block, but looks up only an index instead. [#1057, #1059]
  • BlockChain<T> became not to validate genesis block during fork, where the state store is not an implementation of IBlockStatesStore. [#1063]
  • Fixed a bug where Swarm<T>.GetPeerChainStateAsync() has thrown NullReferenceException when peers in table does failed to respond. [#1066]
  • Fixed a bug where BlockChain<T> had not locked readers–writer lock for state changes during MineBlock(). [#1077, #1087]
  • PolymorphicAction<T>.ToString() became more human-readable. [#1085, #1087]
  • Fixed a bug where MerkleTrie had had MrrkleTrie.EmptyRootHash as root node, which had been unable to insert new nodes. [#1087, #1091]
Assets 20

@github-actions github-actions released this Oct 27, 2020 · 97 commits to main since this release

Released on October 27, 2020.

Backward-incompatible API changes

  • Extracted rendering methods from IAction to IRenderer<T>, which is introduced in this version. From now on, rendering logic needs to be injected from outside through BlockChain<T>.Renderers, rather than IActions knowing how to render themselves. IRenderer<T> also unified BlockChain<T>.TipChanged event, and introduced new events like IActionRenderer<T>.RenderActionError(), IActionRenderer<T>.RenderBlockEnd(), IRenderer<T>.RenderReorg(), and IRenderer<T>.RenderReorgEnd(). [#860, #875, #959, #963]
    • Removed IAction.Render() method, which was replaced by IActionRenderer<T>.RenderAction().
    • Removed IAction.Unrender() method, which was replaced by IActionRenderer<T>.UnrenderAction().
    • Removed BlockChain<T>.TipChanged event, which was replaced by IRenderer<T>.RenderBlock().
    • Removed PolymorphicAction<T>.Render() and Unrender() methods.
    • Removed BlockChain<T>.TipChangedEventArgs class.
  • Added methods related fungible asset states to IAccountStateDelta: [#861, #900, #954]
    • UpdatedFungibleAssetsAccounts property
    • MintAsset(Address, Currency, BigInteger) method
    • TransferAsset(Address, Address, Currency, BigInteger) method
    • BurnAsset(Address, Currency, BigInteger) method
    • GetBalance(Address, Currency) method
  • Added IAccountStateDelta.StateUpdatedAddresses property in order to distinguish state updates from asset states. [#861, #900]
  • Added an optional parameter AccountBalanceGetter accountBalanceGetter to Block<T>.EvaluateActionsPerTx() method. [#861, #900]
  • BlockChain<T>.StageTransaction() became to throw InvalidTxGenesisHashException when it takes a Transaction<T> from a heterogeneous BlockChain<T> with a different genesis block. [#796, #878]
  • Added renderers optional parameter to BlockChain<T>() constructor. [#883, #959, #963]
  • Added BigInteger-typed totalDifficulty parameter to Block<T>() constructor. [#666, #917]
  • Added BigInteger-typed previousTotalDifficulty parameter to Block<T>.Mine() static method. [#666, #917]
  • Added options optional parameter to Swarm<T>() constructor. [#926]
  • ICryptoBackend became to ICryptoBackend<T>. [#932]
  • ICryptoBackend.Verify(HashDigest<SHA256>, byte[], PublicKey) became to ICryptoBackend<T>.Verify(HashDigest<T>, byte[], PublicKey) [#932]
  • Added ICryptoBackend<T>.Sign(HashDigest<T>, PrivateKey) method. [#932]
  • DefaultCryptoBackend became to DefaultCryptoBackend<T>. [#932]
  • Added ImmutableArray<byte>-typed preEvaluationHash parameter to BlockHeader constructor. [#931, #935]
  • Added HashDigest<SHA256>-typed preEvaluationHash parameter to Block<T>() constructor. [#931, #935]
  • Replaced SerializationInfoExtensions.GetValueOrDefault<T>() to SerializationInfoExtensions.TryGetValue<T>(). [#940]
  • Added bool append = true option to both BlockChain<T>.MineBlock() overloaded methods. Although this breaks ABI-level backward compatibility (i.e., you need to rebuild your assemblies), still is backward-compatible at API-level as the option is turned on by default. [#946]
  • Added int? maxTransactions option to both BlockChain<T>.MineBlock() overloaded methods. Although this breaks ABI-level backward compatibility (i.e., you need to rebuild your assemblies), still is backward-compatible at API-level as the option is turned on by default. [#1037, #1039, #1050]
  • Added StateCompleterSet<T>? stateCompleters option to two BlockChain<T>.Append() overloaded methods. Although this breaks ABI-level backward compatibility (i.e., you need to rebuild your assemblies), still is backward-compatible at API-level as the option has the default value (StateCompleterSet<T>.Recalculate). [#946]
  • Added CancellationToken cancellationToken = default(CancellationToken) option to BlockChain<T>.MineBlock(Address miner) overloaded method. Although this breaks ABI-level backward compatibility (i.e., you need to rebuild your assemblies), still is backward-compatible at API-level as the option has the default value. [#946]
  • Added IImmutableSet<Address> trustedStateValidators = null option to both Swarm<T>.StartAsync() overloaded methods. Although this breaks ABI-level backward compatibility (i.e., you need to rebuild your assemblies), still is backward-compatible at API-level as the option is turned on by default. [#946]
  • Removed Peer.AppProtocolVersion property. [#949]
  • Removed Peer.IsCompatibleWith() method. [#949]
  • Replaced Peer(PublicKey, AppProtocolVersion) constructor with Peer(PublicKey) constructor. [#949]
  • Replaced BoundPeer(PublicKey, DnsEndPoint, AppProtocolVersion) constructor with Peer(PublicKey, DnsEndPoint) constructor. [#949]
  • Extracted IStore's some methods dedicated to block states into IBlockStatesStore. [#950]
    • ListStateKeys() method.
    • ListAllStateReferences() method.
    • LookupStateReference() method.
    • IterateStateReferences() method.
    • StoreStateReference() method.
    • ForkStateReferences() method.
    • GetBlockStates() method.
    • SetBlockStates() method.
    • PruneBlockStates() method.
  • The signature of IStore.LookupStateReference<T>(Guid, string, Block<T>) method was changed to LookupStateReference(Guid, string, long). [#950]
  • Added IStateStore-typed stateStore to BlockChain<T> constructor. [#950]
  • Replaced Swarm<T>.FindSpecificPeerAsync(Address, Address, int, BoundPeer, TimeSpan?, CancellationToken) method with Swarm<T>.FindSpecificPeerAsync(Address, int, TimeSpan?, CancellationToken). [#981]
  • Added IActionContext.GetUnconsumedContext() method. [#980]
  • Added ImmutableArray<byte>-typed stateRootHash parameter to BlockHeader constructor. [#986]
  • Added HashDigest<SHA256>-typed stateRootHash parameter to Block<T>() constructor. [#986]
  • Added IBlockPolicy<T>.MaxTransactionsPerBlock property. [#1037, #1050]
  • Added IBlockPolicy<T>.GetMaxBlockBytes() method. [#201, #1050]
  • IBlockPolicy<T>.DoesTransactionFollowPolicy() method became to take additional BlockChain<T> parameter as its context. [#1012]
  • Methods in BlockPolicy<T> class became virtual. [#1010]
  • Added int maxTransactionsPerBlock option to both BlockPolicy<T>() overloaded constructors. [#1037, #1050]
  • Added int maxBlockBytes and int maxGenesisBytes options to both BlockPolicy<T>() overloaded constructors. [#201, #1050]
  • BlockPolicy<T>() constructor's doesTransactionFollowPolicy parameter became Func<Transaction<T>, BlockChain<T>, bool> on . [#1012]
  • Added cacheSize optional parameter to BlockSet<T>() constructor. [#1013]
  • Removed Address(SerializationInfo, StreamingContext) constructor. [#1022]
  • Removed constructors from InvalidMessageException class. [#1021]

Backward-incompatible network protocol changes

  • The message field RecentStates.StateReferences became to IImmutableDictionary<string, IImmutableList<HashDigest<SHA256>>> from IImmutableDictionary<Address, IImmutableList<HashDigest<SHA256>>>. [#912]
  • The existing RecentStates message type (with the type number 0x0f) was replaced by a new RecentStates message type (with the type number 0x13). [#912]
  • Added BlockHeader.TotalDifficulty property. [#666, #917]
  • The existing Pong message type (with the type number 0x02) was replaced by a new Pong message type (with the type number 0x14). [#459, #919, #920, #930]
  • The TimestampThreshold between Block<T>s was changed from 15 minutes to 15 seconds. [#922, #925]
  • Swarm<T> became to have 5 more message types:
  • Every message now contains app protocol version in its header. [#949]
  • The existing BlockHeaderMessage message type (with the type number 0x0d) was replaced by a new BlockHeaderMessage message type (with the type number 0x0c). [#1003, #1004]
  • Removed PreloadBlockDownloadFailEventArgs class. [#1002]
  • Removed blockDownloadFailed parameter from Swarm<T>.PreloadAsync() method. Use SwarmOptions.BlockDownloadTimeout instead. [#1002]

Backward-incompatible storage format changes

  • Added RawTransaction<T>.GenesisHash property. [#796, #878]
  • Added BlockHeader.TotalDifficulty property. [#666, #917]

Added APIs

  • Added Currency struct. [#861, #900, #954]
  • Added FungibleAssetValue struct. [#861, #944, #954]
  • Added AccountBalanceGetter delegate. [#861, #900, #954]
  • Added TurnClient.BindProxies() method. [#756, #868]
  • Added ActionEvaluation.Exception property. [#860, [#875]]
  • Added InvalidTxGenesisHashException class. [#796, #878]
  • Added InvalidBlockBytesLengthException class. [#201, #1050]
  • Added CurrencyPermissionException class. [#861, #900]
  • Added InsufficientBalanceException class. [#861, #900, #954]
  • Added BlockChain<T>.GetBalance() method. [#861, #900]
  • Added Block<T>.TotalDifficulty property. [#666, #917]
  • Added Block<T>.BytesLength property. [#201, #1050]
  • Added SwarmOptions class. [#926]
  • Added PeerChainState struct. [#936]
  • Added Swarm<T>.GetPeerChainStateAsync() method. [#936]
  • Added Swarm<T>.LastMessageTimestamp property. [#964]
  • Added Block<T>.PreEvaluationHash property. [#931, #935]
  • Added BlockHeader.PreEvaluationHash property. [#931, #935]
  • Added Transaction<T>.BytesLength property. [#201, #1050]
  • Added HashDigest(ImmutableArray<byte>) constructor. [#931, #935]
  • Incomplete block states became able to be handled in more flexible way. [#929, #934, #946, #954]
    • Replaced BlockChain<T>.GetState(Address, HashDigest<SHA256>?, bool) method with GetState(Address, HashDigest<SHA256>?, StateCompleter<T>) method. Specifying completeStates: true and false can be replaced by stateCompleter: StateCompleters<T>.Recalculate and StateCompleters<T>.Reject, respectively.
    • Replaced BlockChain<T>.GetBalance(Address, Currency, HashDigest<SHA256>?, bool) method with GetState(Address, Currency, HashDigest<SHA256>?, StateCompleter<T>) method. Specifying completeStates: true and false can be replaced by stateCompleter: FungibleAssetStateCompleters<T>.Recalculate and FungibleAssetStateCompleters<T>.Reject, respectively.
    • Added StateCompleter<T> delegate.
    • Added FungibleAssetStateCompleter<T> delegate.
    • Added StateCompleterSet<T> struct.
    • Added StateCompleters<T> static class.
    • Added FungibleAssetStateCompleters<T> static class.
    • Added Swarm<T>.GetTrustedStateCompleterAsync() method.
  • Added IRenderer<T> interface. [#959, #963]
  • Added IActionRenderer<T> interface. [#959, #967, #970]
  • Added AnonymousRenderer<T> class. [#959, #963]
  • Added AnonymousActionRenderer<T> interface. [#959, #967, #970]
  • Added DelayedRenderer<T> class. [#980, #1029]
  • Added DelayedActionRenderer<T> class. [#980, #1029]
  • Added LoggedRenderer<T> class. [#959, #963]
  • Added LoggedActionRenderer<T> interface. [#959, #967, #970]
  • Added BlockChain<T>.Renderers property. [#945, #959, #963]
  • Added BlockChain<T>.ActionRenderers property. [#959, #967, #970]
  • Added Swarm<T>.AppProtocolVersion property. [#949]
  • DefaultStore became to implement IBlockStatesStore. [#950]
  • Added IStateStore interface. [#950]
  • Added IBlockStatesStore interface. [#950]
  • Added TrieStateStore class. [#939]
  • Added ITrie interface. [#939, #1023]
  • Added MerkleTrie class. [#939, #1023]
  • Added IKeyValueStore interface. [#939]
  • Added DefaultKeyValueStore class. [#939]
  • Added CacheableKeyValueStore class. [#939]
  • (Libplanet.RocksDBStore) RocksDBStore became to implement IBlockStatesStore. [#950]
  • (Libplanet.RocksDBStore) Added RocksDBKeyValueStore. [#939]
  • Added InvalidBlockStateRootHashException class. [#986]
  • Added Block<T>.StateRootHash property. [#986]
  • Added BlockHeader.StateRootHash property. [#986]
  • Added MerkleTrieExtensions static class. [#1023]
  • Added IAccountStateDelta.PreviousStateRootHash property to calculate states until previous action as state root hash. [#1030]
  • Added UnexpectedlyTerminatedActionException.PreviousStateRootHash property. [#1032]

Behavioral changes

  • Improved performance of Swarm<T>.
    • Multiplexed response and broadcast. [#858, #859]
    • Reduced internal delays. [#871, #879]
  • Transaction<T>.Create(), Transaction<T>.EvaluateActions() and Transaction<T>.EvaluateActionsGradually() no longer throw UnexpectedlyTerminatedActionException directly. Instead, it records an exception to ActionEvaluations. [#860, #875]
  • Added Transaction<T>.GenesisHash property. [#796, #878]
  • Added IAccountStateDelta.UpdatedAddresses property contains asset updates besides state updates. [#861, #900]
  • BlockChain<T>.Append() method became to throw InvalidBlockBytesLengthException if the given block's serialized bytes is longer than the limitation configured by IBlockPolicy.GetMaxBlockBytes(). [#201, #1050]
  • BlockChain<T>.MineBlock() method became to cut off transactions to include to fit into the limitation configured by IBlockPolicy.GetMaxBlockBytes(). [#201, #1050]
  • Swarm<T> became to ignore received transaction with different genesis hash. [#796, #878]
  • Swarm<T> became to ignore invalid BlockHeaders immediately. [#898]
  • Swarm<T>.PreloadAsync() became to clean up only temporary chains. [#902]
  • BlockPolicy<T> became to validate Block<T>.TotalDifficulty property of a Block<T>. [#666, #917]
  • Swarm<T> became to preload from peer that has the most difficult chain. [#459, #919]
  • Swarm<T> became to promote the most difficult chain as a canonical chain instead of the longest chain. [#459, #919]
  • Swarm<T>.BootstrapAsync() method became not to throw TimeoutException when it fails to connect to all neighbors. [#933]
  • Swarm<T> became to respond to the messages with different app protocol version. [#949]
  • Swarm<T>.PreloadAsync() became to execute the actions from the branchpoint rather than the genesis block when there is a branch point. [#991]
  • BlockPolicy<T> became to validate Block<T>.StateRootHash property of a Block<T>. [#986]
  • Swarm<T> became not to sync Block<T>s from the peers with different genesis block. [#1003, #1004]
  • Swarm<T> became to ignore BlockHeaderMessage from the peers with different genesis block. [#1003, #1004]
  • BlockChain<T> instead of BlockPolicy<T> became to validate Block<T>s to append so that even if an empty implementation of IBlockPolicy<T> is used Block<T>s are unable to be appended to BlockChain<T>. [#1010]
  • BlockSet<T>[HashDigest<SHA256>] and BlockChain<T>.Genesis became cached so that they become faster to get. [#1013]
  • Swarm<T>.PreloadAsync() became to do not render blocks. [#1029]

Bug fixes

  • Fixed a bug that Swarm<T> had failed to receive a request from TURN relay connections. [#404, #871, #890]
  • Fixed a bug where Swarm<T> had been terminated and never reconnected when it had been once disconnected from TURN (mostly due to sleep mode, etc.). [#909]
  • Fixed a bug in which pre-computed state delivery had failed when a state key is not an Address when preloading. [#912]
  • Fixed a bug where UnexpectedlyTerminatedException hadn't been serialized with BinaryFormatter. [#913]
  • Fixed a bug where TurnClient hadn't applied cancellation token to its connections. [#916]
  • Fixed a bug where BlockChain<T>.GetRawState() had overwritten block states without read lock. [#927]
  • Fixed a bug that Swarm<T> had not respond to GetRecentStates message when the target block does not exist in the chain. [#941]
  • Fixed a bug that Swarm<T>.StartAsync() had not worked after Swarm<T>.StopAsync() was once called. [#965]
  • Fixed a bug that TurnClient had thrown InvalidOperationException when reconnecting. [#957, #972]
  • Fixed a bug that Swarm<T> had not received block headers after failing to receive previous blocks. [#996]
  • Fixed a bug that Swarm<T> had thrown InvalidGenesisBlockException when reorg its chain repeatedly. [#996]
  • Fixed a bug that Swarm<T> had propagated invalid transactions. [#1043]

Static analyzer

  • Introduced the Libplanet.Analyzers package, a Roslyn Analyzer, which checks if code has common mistakes prone to made with Libplanet-powered game apps, e.g., breaking determinism in IAction implementations. [#1034]

CLI tools

  • The planet command became installable using npm. [#923, #982]
  • Fixed a bug that ^H had not removed the rightmost character in passphrase prompts. [#983, #984]
  • Added a new sub-command planet mpt. [#1023, #1026]
  • Introduced a configuration file. It's placed in: [#1023, #1026]
    • Linux/macOS: $XDG_CONFIG_HOME/planetarium/cli.json
    • Windows: %AppData%\planetarium\cli.json
Assets 21
  • 0.9.5
  • b8b5b25
  • Compare
    Choose a tag to compare
    Search for a tag
  • 0.9.5
  • b8b5b25
  • Compare
    Choose a tag to compare
    Search for a tag

@github-actions github-actions released this Jun 12, 2020 · 782 commits to main since this release

Released on June 12, 2020.

  • Fixed a bug that had not properly received block hashes after the chain had reorged. [#880, #905]
Assets 15

@github-actions github-actions released this Jun 2, 2020 · 788 commits to main since this release

Released on June 2, 2020.

  • (Libplanet.RocksDBStore) Fixed a bug that RocksDBStore.DeleteChainId() method had thrown KeyNotFoundException when there's no such chain ID. [#891]
  • (Libplanet.RocksDBStore) Fixed a bug that RocksDBStore had written logs into the incorrect context DefaultContext, not RocksDBStore the correct one. [#891]
Assets 15

@github-actions github-actions released this May 29, 2020 · 792 commits to main since this release

Released on May 29, 2020.

  • Fixed a Swarm<T>.PreloadAsync() method's bug that had hanged in a state downloading block hashes and finally unexpectedly terminated when a peer's chain had gotten reorged. [#880, #884]
Assets 16
  • 0.9.2
  • 2bb11fb
  • Compare
    Choose a tag to compare
    Search for a tag
  • 0.9.2
  • 2bb11fb
  • Compare
    Choose a tag to compare
    Search for a tag

@github-actions github-actions released this May 20, 2020 · 801 commits to main since this release

Released on May 20, 2020.

  • (Libplanet.RocksDBStore) Fixed a memory leak bug in RocksDBStore. [#870]
Assets 16

@github-actions github-actions released this May 7, 2020 · 808 commits to main since this release

Released on May 7, 2020.

  • Fixed a bug where the canonical chain had changed if any actions had thrown an exception during Swarm<T>.PreloadAsync(). [#862]
  • Fixed a Swarm<T>.PreloadAsync() method's bug that it had hung forever and raised InvalidOperationException. [#847, #864]
Assets 16

@github-actions github-actions released this Apr 27, 2020

Released on April 27, 2020.

Backward-incompatible API changes

  • BaseStore class became to implement IDisposable. [#789]
  • Removed IStore.DeleteIndex(Guid, HashDigest<SHA256>) method. [#802]
  • Extension classes was renamed. However, it would not be affected if you have called it by using instance method syntax. [#803]
    • Renamed StunAddressExtension class to StunAddressExtensions.
    • Renamed BytesConvertExtension class to BytesConvertExtensions.
    • Renamed RandomExtension class to RandomExtensions.
    • Renamed AddressExtension class to AddressExtensions.
    • Renamed HashDigestExtension class to HashDigestExtensions.
    • Renamed NetMQFrameExtension class to NetMQFrameExtensions.
    • Renamed NetMQSocketExtension class to NetMQSocketExtensions.
    • Renamed SerializationInfoExtension class to SerializationInfoExtensions.
    • Renamed StoreExtension class to StoreExtensions.
  • All parameters, fields, property, and method return values that had been represented as an Int32 became retyped to AppProtocolVersion. [#266, #815]
    • Swarm() constructor's parameter appProtocolVersion became AppProtocolVersion (was Int32).
    • Peer() and BoundPeer() constructors' parameter appProtocolVersion became AppProtocolVersion (was Int32).
    • Peer.AppProtocolVersion property became AppProtocolVersion (was Int32).
    • DifferentProtocolVersionEventArgs.ExpectedVersion and DifferentProtocolVersionEventArgs.ActualVersion properties became AppProtocolVersion (was Int32).
    • Removed DifferentAppProtocolVersionException class.
  • Swarm() constructor's EventHandler<DifferentProtocolVersionEventArgs> differentVersionPeerEncountered = null parameter became replaced by DifferentAppProtocolVersionEncountered differentAppProtocolVersionEncountered = null parameter. [#266, #815]
  • Added IEnumerable<PublicKey> trustedAppProtocolVersionSigners = null parameter to Swarm() constructor. [#266, #815]
  • Removed DifferentProtocolVersionEventArgs class. [#266, #815]
  • Removed createdAt parameter from Swarm() constructor. [#838]
  • Replaced BlockChain<T>.StageTransactions() with .StageTransaction() that receives only one transaction. [#820]
  • Replaced BlockChain<T>.UnstageTransactions() with .UnstageTransaction() that receives only one transaction. [#820]
  • Added IBlockPolicy.DoesTransactionFollowPolicy() method which is a method to determine if a transaction follows the block policy. [#827]

Backward-incompatible network protocol changes

  • The existing BlockHashes message type (with the type number 0x05) was replaced by a new BlockHashes message type (with type number 0x0e) in order to include an offset block index besides block hashes so that a receiver is able to determine their block indices too. [#707, #798]
  • Peer became to have 3 more fields to represent the whole fields of AppProtocolVersion, which is newly introduced. [#266, #815]
  • The existing RecentStates message type (with the type number 0x0c) was replaced by a new RecentStates message type (with type number 0x0f) in order to compress its states. [#700, #850]

Added APIs

  • Added AddressExtensions.ToAddress(this PrivateKey) overloaded extension method. [#825]
  • Added BlockHashDownloadState class, a subclass of PreloadState. [#707, #798]
  • Added BlockVerificationState class, a subclass of PreloadState. [#798]
  • Added AppProtocolVersion struct. [#266, #815]
  • Added IKeyStore interface. [#831]
  • Added Web3KeyStore class. [#831]
  • Added BlockDigest struct. [#785]
  • Added BlockHeader struct. [#785]
  • Added IStore.GetBlockDigest(HashDigest<SHA256>) method. [#785]
  • Added Block<T>.ToBlockDigest() method. [#785]
  • Added ByteArrayExtensions class. [#803]
  • Added IStore.PruneBlockStates<T>(Guid, Block<T>) method. [#790]
  • Added DifferentAppProtocolVersionEncountered delegate. [#266, #815]
  • Added Swarm<T>.TrustedAppProtocolVersionSigners property. [#266, #815]
  • Added Peer.IsCompatibleWith() method. [#266, #815]
  • Added TxViolatingBlockPolicyException class. [#827]
  • Added KeyStoreException class. [#831]
  • Added NoKeyException class. [#831]

Behavioral changes

  • BlockChain.MineBlock() method became to ignore transactions having lower nonce than the expected nonce in the chain. [#791]
  • Swarm<T>.PreloadAsync() and Swarm<T>.StartAsync() became to download only a list of block hashes first and then download blocks from simultaneously multiple peers. [#707, #798]
  • Improved performance of Swarm<T> by preventing unnecessary task creation. [#817, #837]
  • Improved performance of Swarm<T>.PreloadAsync() by parallelizing connections. [#846]
  • Improved response throughput of Swarm<T>. [#849]

Bug fixes

  • Swarm<T> became not to sync the same Block<T>s or Transaction<T>s multiple times. [#784]
  • Fixed a Swarm<T>'s bug that had broadcasted a message to its source peer when the number of peers is not enough (less than the minimum number). [#788]
  • Fixed a bug where BlockChain.MineBlock() had produced an invalid block when there is any staged transaction which has lower nonce than the expected nonce, that means, shares an already taken nonce by the same signer. [#791]
  • Fixed a Swarm<T>.PreloadAsync() method's bug that temporary chain IDs in the store had been completely cleaned up in some corner cases if cancellationToken was requested. [#798]
  • Fixed a bug where Swarm<T> had crashed if it received invalid Transaction<T> from the nodes. [#820]
  • Fixed a bug where Swarm<T> hadn't reported IProgress<PreloadState>s correctly.[#839]
  • Fixed a Swarm<T>.PreloadAsync() method's bug that it had hung forever when a block failed to be fetched due to an unexpected inner exception. [#839]
  • Fixed a bug where actions had been evaluated twice when receiving blocks. [#843, #844]
  • Fixed OverflowException being thrown when a passphrase containing any non-ASCII characters was passed to Pbkdf2.Derive() method or ProtectedPrivateKey.Protect() method. [#845]

CLI tools

  • Added the planet command and its alias dotnet planet.
Assets 8

@github-actions github-actions released this Feb 4, 2020 · 1064 commits to main since this release

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]
Assets 3
You can’t perform that action at this time.