libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming

LGPL-2.1 License

Downloads
10.1K
Stars
489
Committers
79

Bot releases are visible (Hide)

libplanet - Libplanet 0.21.3

Published by github-actions[bot] almost 3 years ago

Released on December 5, 2021.

  • Removed ITransport.MessageHistory property due to memory leak. [#1638]
libplanet - Libplanet 0.22.1

Published by github-actions[bot] almost 3 years ago

Released on December 5, 2021.

  • Compacted log output for convenience. [#1633]
  • Removed ITransport.MessageHistory property due to memory leak. [#1639]
libplanet - Libplanet 0.22.0

Published by github-actions[bot] almost 3 years ago

Released on November 30, 2021.

Backward-incompatible API changes

  • Removed Transaction<T>.BytesLength property. [#1609]
  • Removed Block<T>.BytesLength property. [#1609]
  • The types of BlockChain<T>.MineBlock() overloaded methods' maxBlockBytes parameters became long? (were int?). [#1609]
  • The type of IBlockPolicy<T>.GetMaxBlockBytes(long) method became long (was int). [#1609]
  • The type of BlockPolicy<T>() constructor's getMaxBlockBytes parameter became Func<long, long>? (was Func<long, int>?). [#1609]
  • The type of InvalidBlockBytesLengthException() constructor's bytesLength parameter became long (was int). [#1609]
  • The type of InvalidBlockBytesLengthException.BytesLength property became long (was int). [#1609]
  • Methods IsEmpty() and IsFull() of KBucket changed to properties IsEmpty and IsFull respectively. [#1610]
  • MessageCodec class renamed to TcpMessageCodec. [#1610]
  • lifetime parameter removed from IMessageCodec.Decode(). messageLifespan parameter added to constructors of NetMQMessageCodec and TcpMessageCodec. [#1610]
  • Removed unused PeerStates property from Swarm<T>. [#1610]
  • Method name BoundPeer.QueryAppProtocolVersion() changed to BoundPeer.QueryAppProtocolVersionNetMQ(). [#1610]

Behavioral changes

  • Swarm<T> became to append blocks to forked chain to avoid locking the canonical chain while syncing recent blocks. [#1606]
  • More streamlined structured logging together with additional logs tagged as Metric. [#1627]

Bug fixes

  • InvalidMagicCookieException and InvalidTimestampException can now be serialized and deserialized. [#1613]
  • Fixed a bug where PolymorphicAction<T> had thrown InvalidCastException when inner action's .PlainValue returns other value than Bencodex.Types.Dictionary. [#1628]

Dependencies

libplanet - Libplanet 0.21.2

Published by github-actions[bot] almost 3 years ago

Released on November 25, 2021.

  • planet apv query command became to communicate with NetMQTransport instead of TcpTransport. [#1618]
libplanet - Libplanet 0.21.1

Published by github-actions[bot] almost 3 years ago

Released on November 25, 2021.

  • SwarmOptions.TipLifespan property' default value was changed. The default lifespan for a tip going stale is now 60 seconds instead of 30 seconds for the purpose of polling blocks. [#1614]
  • Swarm<T>'s internal logic for determining when the BlockChain<T>.Tip becomes stale is now fixed. [#1614]
libplanet - Libplanet 0.21.0

Published by github-actions[bot] almost 3 years ago

Released on November 16, 2021.

Backward-incompatible API changes

  • (Libplanet.RocksDBStore) Removed MonoRocksDBStore class. [#1513, #1579]
  • Removed rehearsal parameter from ITrie.Commit() method. [#1554, #1570]
  • Removed rehearsal parameter from StateStoreExtensions.Commit() extension method. [#1554, #1570]
  • Removed ITransport.RunAsync() method. ITransport.StartAsync() now conducts operation that ITransport.RunAsync() used to conduct. [#1523]
  • Removed ITransport.ReplyMessage() method which was non-blocking. Instead, added ITransport.ReplyMessageAsync() asynchronous method which is awaited until the reply message is sent. [#1523]
  • The type of ITransport.ProcessMessageHandler became AsyncDelegate<T> (which was EventHandler). [#1523]
  • Removed unused BlockChain<T> type parameter from IStagePolicy<T>.Iterate() method. [#1553, #1556]
  • Removed unsued HashAlgorithmTable class. [#1600]
  • BlockChain<T>.MineBlock() and BlockChain<T>.GatherTransactionsToMine() now additionally accepts maxBlockBytes parameter of type int. [#1600]
  • Removed BlockInsufficientTxsException and BlockExceedingTransactionsException classes. [#1504, #1600]

Added APIs

  • Added ITransport.MessageHistory property. [#1523]
  • Added ITransport.WaitForRunning() method. [#1523]
  • Added TcpTransport class which implements ITransport interface. [#1523]
  • Added SwarmOptions.Type property. [#1523]
  • Added SwarmOptions.TransportType enum. [#1523]
  • Added AsyncDelegate<T> class. [#1523]
  • Added InvalidMagicCookieException class. [#1523]
  • Added MessageCodec class which inherits IMessageCodec<T>. [#1523]
  • Added IStagePolicy<T>.GetNextTxNonce() method. [#1553, #1556]
  • Added InvalidBlockBytesLengthException, InvalidBlockTxCountException, InvalidBlockHashAlgorithmTypeException, and InvalidBlockTxCountPerSignerException classes. [#1504, #1600]

Behavioral changes

  • Improved performance of MerkleTrie.Commit() and BlockChain<T>.ExecuteActions() methods. [#1554, #1570]
  • Swarm<T>.MineBlock() now throws OperationCanceledException instead of BlockInsufficientTxsException when there are no sufficient number of blocks to mine. [#1600]
  • Default implementation BlockPolicy<T>.ValidateNextBlock() of IBlockPolicy<T> now validates the type for Block<T>.HashAlgorithm, size for Block<T>.BytesLength, and count for Block<T>.Transactions. [#1504, #1600]

CLI tools

  • planet stats command's -p/--path option no more supports the store type monorocksdb. [#1513, #1579]
  • Subcommands under planet store no more supports the store type monorocksdb. [#1513, #1579]
libplanet - Libplanet 0.20.2

Published by github-actions[bot] almost 3 years ago

Released on November 9, 2021.

  • (Libplnaet.RocksDBStore) Fixed DefaultStore.ForkBlockIndexes() method's bug that it had been thrown ChainIdNotFoundException when received a chain forked from already deleted. [#1591, #1592]
  • Fixed improper implementations of BlockExceedingTransactionsException InvalidBlockBytesLengthException in regards to serialization and related tests. [#1594]
libplanet - Libplanet 0.20.1

Published by github-actions[bot] almost 3 years ago

Released on November 8, 2021.

  • Swarm<T> became to broadcast a new block to peers immediately after Swarm<T>.BlockChain's Tip changes while it is Running. [#1582]
libplanet - Libplanet 0.19.3

Published by github-actions[bot] almost 3 years ago

Released on November 8, 2021.

  • Swarm<T> became to broadcast a new block to peers immediately after Swarm<T>.BlockChain's Tip changes while it is Running. [#1582]
libplanet - Libplanet 0.20.0

Published by github-actions[bot] almost 3 years ago

Released on November 3, 2021.

Deprecated APIs

  • (Libplanet.RocksDBStore) MonoRocksDBStore will be gone in the next minor release: 0.21.0. [#1513, #1574]

Backward-incompatible API changes

  • Removed unused BlockChain<T> type parameter from IStagePolicy<T>.Iterate() method. [#1553, #1556]

Added APIs

  • Added IStagePolicy<T>.GetNextTxNonce() method. [#1553, #1556]
libplanet - Libplanet 0.19.2

Published by github-actions[bot] almost 3 years ago

Released on November 3, 2021.

  • PrivateKey(IReadOnlyList<byte>) overloaded constructor no more accepts a list shorter or longer than 32 bytes. [#1571, #1572]
  • PrivateKey.FromString() method no more accept a hexadecimal digits shorter or longer than 64 characters. [#1571, #1572]
  • Fixed a bug where HashAlgorithmType.Digest(byte[]) and HashAlgorithmType.Digest(ImmutableArray<byte>) methods had returned a wrong hash digest after HashAlgorithmType.Digest(IEnumerable<byte[]>) or HashAlgorithmType.Digest(IEnumerable<ImmutableArray<byte>>) methods had been once called. [#1575, #1576]
libplanet - Libplanet 0.18.5

Published by github-actions[bot] almost 3 years ago

Released on November 3, 2021.

  • Fixed a bug where HashAlgorithmType.Digest(byte[]) and HashAlgorithmType.Digest(ImmutableArray<byte>) methods had returned a wrong hash digest after HashAlgorithmType.Digest(IEnumerable<byte[]>) or HashAlgorithmType.Digest(IEnumerable<ImmutableArray<byte>>) methods had been once called. [#1575]
libplanet - Libplanet 0.18.4

Published by github-actions[bot] almost 3 years ago

Released on November 2, 2021.

  • PrivateKey(IReadOnlyList<byte>) overloaded constructor no more accepts a list shorter or longer than 32 bytes. [[#1571]]
  • PrivateKey.FromString() method no more accept a hexadecimal digits shorter or longer than 64 characters. [[#1571]]
libplanet - Libplanet 0.19.1

Published by github-actions[bot] almost 3 years ago

Released on October 29, 2021.

  • BlockMetadata.MineNonce() method and other mining methods based on it now do not spawn a new thread if the workers is less than 2. [#1564]
  • BlockMetadata.MineNonce() method and other mining methods based on it now uses the half of the present logical processors (i.e., Environment.ProcessorCount / 2) by default. If there is only one logical processor, uses one worker. [#1564]
  • Rolled back the order of the header of a Message so that it is compatible with nodes based on Libplanet pre-0.19.0. [#1565]
libplanet - Libplanet 0.18.3

Published by github-actions[bot] almost 3 years ago

Released on October 28, 2021. Mainly backported critical bug fixes from 0.19.0. [#1562]

  • Swarm<T>.StartAsync() method became to poll neighbor peers if they have any new blocks whether Swarm<T>.BlockDemandTable is empty or not. The polling is triggered when Swarm<T>.BlockChain's Tip has been unchanged for a while. [#1557]
  • Fixed Swarm<T>'s bug that it had thrown PingTimeoutException if any peer in configured SwarmOptions.StaticPeers is unreachable. [#1550, #1551]
  • Fixed a bug where Swarm<T> did not removed failed block demands from the BlockDemandTable. [#1549]
libplanet - Libplanet 0.19.0

Published by github-actions[bot] almost 3 years ago

Released on October 27, 2021.

Backward-incompatible API changes

  • Removed IStore.StageTransactionIds() method. [#1166, #1535]
  • Removed IStore.UnstageTransactionIds() method. [#1166, #1535]
  • Removed IStore.IterateStagedTransactionIds() method. [#1166, #1535]
  • Removed Message.ToNetMQMessage() method. Use IMessageCodec<T>.Encode() method instead. [#1503]
  • Removed Message.Parse() static method. Use IMessageCodec<T>.Decode() method instead. [#1503]
  • Removed unused HashAlgorithmGetter type parameter from ActionEvaluator<T>() constructor. [#1537]
  • Hashcash.Answer() method became to take random seed value explicitly. [#1546]

Backward-incompatible network protocol changes

  • The order of the header of a NetMQMessage has been modified. [#1503]

Added APIs

  • Added BlockMetadata.MineNonce(HashAlgorithmType, int, CancellationToken) overloaded method. [#1546]
  • Added Message.MessageFrame enum. [#1503]
  • Added Message.Type property. [#1503]
  • Added Message.DataFrames property. [#1503]
  • Added IMessageCodec<T> interface. [#1503]
  • Added NetMQMessageCodec class which inherits IMessageCodec<T>. [#1503]
  • Added MemoryStore class. [#1544]
  • Added MemoryKeyValueStore class. [#1544]
  • Added BlockDemandTable.Remove() method. [#1549]
  • Added SwarmOptions.TipLifespan property. [#1557]

Behavioral changes

  • BlockMetadata.MineNonce() method became to use multithreading when looking for the nonce. [#1546]
  • IStore.ForkTxNonces() method became to throw ChainIdNotFoundException when a given sourceChainId does not exist. [#1544]
  • Swarm<T>.StartAsync() method became to poll neighbor peers if they have any new blocks whether Swarm<T>.BlockDemandTable is empty or not. The polling is triggered when Swarm<T>.BlockChain's Tip has been unchanged for a while. Expiration time for tips can be configured through SwarmOptions.TipLifespan property. [#1557]

Bug fixes

  • Fixed DefaultStore.ForkBlockIndexes() method's bug that it had done silently no-op when a given sourceChainId had not existed, which had not been compliant with IStore.ForkBlockIndexes() method's specification. [#1544]
  • Fixed Swarm<T>'s bug that it had thrown PingTimeoutException if any peer in configured SwarmOptions.StaticPeers is unreachable. [#1550, #1551]
  • (Libplanet.RocksDBStore) Fixed RocksDBStore.ForkBlockIndexes() method's bug that it had done silently no-op when a given sourceChainId had not existed, which had not been compliant with IStore.ForkBlockIndexes() method's specification. [#1544]
  • (Libplanet.RocksDBStore) Fixed MonoRocksDBStore.ForkBlockIndexes() method's bug that it had done silently no-op when a given sourceChainId had not existed, which had not been compliant with IStore.ForkBlockIndexes() method's specification. [#1544]
  • Fixed a bug where Swarm<T> did not removed failed block demands from the BlockDemandTable. [#1549]
libplanet - Libplanet 0.18.2

Published by github-actions[bot] almost 3 years ago

Released on October 22, 2021.

  • Fixed a bug that Swarm<T> had not responded to GetBlocks requests when some of requested blocks fail to be loaded. It now sends a Blocks response with successfully loaded blocks for the same situation. [#1540]
libplanet - Libplanet 0.18.1

Published by github-actions[bot] almost 3 years ago

Released on October 21, 2021.

  • Fixed a bug where PublicKey.Verify() method had thrown exceptions for some invalid inputs. [#1520]
  • BaseStore.GetBlock<T>() method now throws InvalidOperationException when it fails to load a requested block's transactions. [#1500, #1532]
  • (Libplanet.RocksDBStore) Operations on RocksDBStore that update data no longer suppress the internal failures. [#1500, #1532]
libplanet - Libplanet 0.18.0

Published by github-actions[bot] about 3 years ago

Released on October 13, 2021.

Backward-incompatible API changes

  • Hashcash.Stamp(Nonce) delegate's return type became IEnumerable<byte[]> (was byte[]). [#1492]
  • Moved BlockDigest struct to Libplanet.Store namespace (from Libplanet.Blocks namespace). [#1492]
  • Removed Block<T>.ToBlockDigest() method. Use BlockDigest.FromBlock<T>() static method instead. [#1492]
  • ActionEvaluator<T>.Evaluate() method's block parameter became to take IPreEvaluationBlock<T> (was IBlock<T>). [#1146, #1164, #1492]
  • Block<T> and BlockHeader now guarantees that their every instance has integrity. [#1164, #1492]
    • Block<T> became unable to be subclassed.
    • Remove Block<T>(long, long, BigInteger, Nonce, Address, BlockHash?, DateTimeOffset, IReadOnlyList<Transaction<T>>, HashAlgorithmType, HashDigest<SHA256>, ImmutableArray<byte>?, int) overloaded constructor. Use other overloaded constructors instead.
    • Added Block<T>(IBlockHeader header, IEnumerable<Transaction<T>>) overloaded constructor.
    • Added Block<T>(PreEvaluationBlock<T>, HashDigest<SHA256>, ImmutableArray<byte>?) overloaded constructor. [#1457, #1507]
    • BlockHeader is no more readonly struct, but a sealed class.
    • Removed BlockHeader(int, long, string, ImmutableArray<byte>, ImmutableArray<byte>, long, BigInteger, ImmutableArray<byte>, ImmutableArray<byte>, ImmutableArray<byte>, ImmutableArray<byte>, ImmutableArray<byte>) constructor. Use other overloaded constructors instead.
    • Added BlockHeader(PreEvaluationBlockHeader, HashDigest<SHA256>, ImmutableArray<byte>?) overloaded constructor. [#1457, #1507]
    • Added BlockHeader(PreEvaluationBlockHeader, HashDigest<SHA256>, ImmutableArray<byte>?, BlockHash) overloaded constructor. [#1457, #1507]
  • Block<T> and BlockHeader have no more marshaling/unmarshaling methods.
    • Removed Block<T>(Bencodex.Types.Dictionary) overloaded constructor. Use BlockMarshaler.UnmarshalBlock() static method instead.
    • Removed Block<T>.Deserialize() static method. Instead, use BlockMarshaler.UnmarshalBlock() static method and Bencodex.Codec together.
    • Removed Block<T>.ToBencodex() method. Use BlockMarshaler.MarshalBlock() static method instead.
    • Removed Block<T>.Serialize() method. Instead, use BlockMarshaler.MarshalBlock() static method and Bencodex.Codec together.
    • Removed BlockHeader(Bencodex.Types.Dictionary) overloaded constructor. Use BlockMarshaler.UnmarshalBlockHeader() static method instead.
    • Removed BlockHeader.Deserialize() static method. Instead, use BlockMarshaler.UnmarshalBlockHeader() static method and Bencodex.Codec together.
    • Removed BlockHeader.ToBencodex() method. Use BlockMarshaler.MarshalBlockHeader() static method instead.
    • Removed BlockHeader.Serialize() method. Instead, use BlockMarshaler.MarshalBlockHeader() static method and Bencodex.Codec together.
  • Block<T> and BlockHeader now guarantee that their every instance has its StateRootHash. [#1128, #1146, #1492]
    • Block<T>.StateRootHash property's type became HashDigest<SHA256> (was HashDigest<SHA256>?).
    • Removed Block<T>(Block<T>, HashDigest<SHA256>) overloaded constructor. Use Block<T>(PreEvaluationBlock<T>, HashDigest<SHA256>) overloaded constructor instead.
    • Removed Block<T>.Mine() static method. Use BlockContent<T>.Mine() and PreEvaluationBlock<T>.Evaluate() methods instead.
    • BlockHeader.StateRootHash property's type became HashDigest<SHA256> (was HashDigest<SHA256>?).
    • The type of InvalidBlockStateRootHashException() constructor's expectedStateRootHash parameter became HashDigest<SHA256> (was HashDigest<SHA256>?). [#1507]
    • InvalidBlockStateRootHashException.ExpectedStateRootHash property's type became HashDigest<SHA256> (was HashDigest<SHA256>?). [#1507]
  • Block<T> and BlockHeader became aware of HashAlgorithmType used for proof-of-work mining. [#1492]
    • Added Block<T>.HashAlgorithm property.
    • Added BlockHeader.HashAlgorithm property.
    • Removed BlockHeader(int, long, DateTimeOffset, Nonce, Address, long, BigInteger, BlockHash?, HashDigest<SHA256>?, BlockHash, ImmutableArray<byte>, HashDigest<SHA256>?) constructor. Use BlockHeader(int, long, DateTimeOffset, Nonce, Address, long, BigInteger, BlockHash?, HashDigest<SHA256>?, BlockHash, ImmutableArray<byte>, HashDigest<SHA256>, HashAlgorithmType) constructor instead.
    • Added HashAlgorithmGetter hashAlgorithmGetter parameter to IStore.GetBlock<T>() method.
    • Removed BlockDigest.Header property. Use BlockDigest.GetHeader() method instead.
    • Added BlockDigest.GetHeader() method.
    • Added HashAlgorithmGetter hashAlgorithmGetter parameter to DelayedRenderer<T>() constructor.
    • Added HashAlgorithmGetter hashAlgorithmGetter parameter to DelayedActionRenderer<T>() constructor.
    • Added DelayedRenderer<T>.HashAlgorithmGetter property.
  • Blocks became signed by the miner since the protocol version 2. [#1457, #1507]
    • Added Block<T>(PreEvaluationBlock<T>, HashDigest<SHA256>, ImmutableArray<byte>?) overloaded constructor. [#1164, #1492]
    • Added BlockHeader(PreEvaluationBlockHeader, HashDigest<SHA256>, ImmutableArray<byte>?) overloaded constructor. [#1164, #1492]
    • Added BlockHeader(PreEvaluationBlockHeader, HashDigest<SHA256>, ImmutableArray<byte>?, BlockHash) overloaded constructor. [#1164, #1492]
    • Added Block<T>.Signature property.
    • Added Block<T>.PublicKey property.
    • Added BlockHeader.Signature property.
    • Added BlockHeader.PublicKey property.
    • Added InvalidBlockPublicKeyException class.
    • Added InvalidBlockSignatureException class.
  • IStateStore now requires implementations to be trie. [#1128, #1146, #1492]
    • Added IStateStore.GetStateRoot() method.
    • Added IStateStore.PruneStates() method.
    • Removed IStateStore.SetStates<T>() method.
    • Removed IStateStore.GetState() method.
    • Removed IStateStore.ContainsBlockStates() method.
    • Removed IStateStore.ForkStates<T>() method.
  • TrieStateStore no more stores associations between Block<T>.Hash/Block<T>.PreEvaluationHash and Block<T>.StateRootHash, because Block<T>.StateRootHash became mandatory. [#1128, #1146, #1492]
    • Added ITrie.Recorded property.
    • Removed IKeyValueStore stateHashKeyValueStore parameter from TrieStateStore() constructor.
    • Removed TrieStateStore.GetTrie() method.
    • Removed TrieStateStore.GetRootHash() method.
    • Replaced TrieStateStore.PruneStates(IImmutableSet<BlockHash>) method with TrieStateStore.PruneStates(IImmutableSet<HashDigest<SHA256>>) method.
  • The types of BlockChain<T>.MineBlock() overloaded methods' miner parameter became PrivateKey (were Address). [#1457, #1507]

Backward-incompatible network protocol changes

  • The Block<T>.CurrentProtocolVersion is bumped from 1 to 2: [#1507]
    • Block's total difficulty value became included to the input of block hashes and pre-evaluation hashes since the protocol version 2.
    • Blocks became to have miner's public key as well since the protocol version 2. [#1457]
    • Blocks became to have no miner's address since the protocol version 2, because it can be derived from miner's public key. [#1457]
    • Blocks became to have a signature made using miner's private key since the protocol version 2. Block signatures affect block hashes. [#1457]

Added APIs

  • Added BlockMetadata class. [#1164, #1457, #1492, #1507]
  • Added BlockContent<T> class. [#1164, #1492]
  • Added PreEvaluationBlockHeader class. [#1146, #1164, #1457, #1492, #1507]
  • Added PreEvaluationBlock<T> class. [#1146, #1164, #1457, #1492, #1507]
  • Added BlockDigest.FromBlock<T>() static method. [#1492]
  • Added Block<T>(PreEvaluationBlock<T>, HashDigest<SHA256>) overloaded constructor. [#1146, #1164, #1492]
  • Added Block<T>.HashAlgorithm property. [#1492]
  • Added Block<T>.PublicKey property. [#1457, #1507]
  • Added Block<T>.Signature property. [#1457, #1507]
  • Added Block<T>(PreEvaluationBlock<T>, HashDigest<SHA256>, ImmutableArray<byte>?) overloaded constructor. [#1164, #1457, #1492, #1507]
  • Added Block<T>(IBlockHeader, IEnumerable<Transaction<T>>) overloaded constructor. [#1164, #1492]
  • Added BlockHeader.HashAlgorithm property. [#1492]
  • Added BlockHeader.PublicKey property. [#1457, #1507]
  • Added BlockHeader.Signature property. [#1457, #1507]
  • Added BlockHeader(PreEvaluationBlockHeader, HashDigest<SHA256>, ImmutableArray<byte>?) overloaded constructor. [#1164, #1457, #1492, #1507]
  • Added BlockHeader(PreEvaluationBlockHeader, HashDigest<SHA256>, ImmutableArray<byte>?, BlockHash) overloaded constructor. [#1164, #1457, #1492, #1507]
  • Added IBlockMetadata interface. [#1164, #1457, #1492, #1507]
    • Block<T> became to implement IBlockMetadata interface.
    • BlockHeader became to implement IBlockMetadata interface.
    • BlockMetadata became to implement IBlockMetadata interface.
    • BlockContent<T> became to implement IBlockMetadata interface.
    • PreEvaluationBlockHeader became to implement IBlockMetadata interface.
    • PreEvaluationBlock<T> became to implement IBlockMetadata interface.
    • BlockDigest became to implement IBlockMetadata interface.
  • Added IBlockContent<T> interface. [#1164, #1492]
    • Block<T> became to implement IBlockContent<T> interface.
    • BlockContent<T> became to implement IBlockContent<T> interface.
    • PreEvaluationBlock<T> became to implement IBlockContent<T> interface.
  • Added IPreEvaluationBlockHeader interface. [#1164, #1492]
    • Block<T> became to implement IPreEvaluationBlockHeader interface.
    • BlockHeader became to implement IPreEvaluationBlockHeader interface.
    • PreEvaluationBlockHeader became to implement IPreEvaluationBlockHeader interface.
    • PreEvaluationBlock<T> became to implement IPreEvaluationBlockHeader interface.
  • Added IPreEvaluationBlock<T> interface. [#1164, #1492]
    • Block<T> became to implement IPreEvaluationBlock<T> interface.
    • PreEvaluationBlock<T> became to implement IPreEvaluationBlock<T> interface.
    • ActionEvaluator<T>.Evaluate() method's block parameter became to take IPreEvaluationBlock<T> (was IBlock<T>).
  • Added IBlockHeader interface. [#1146, #1164, #1492]
    • Block<T> became to implement IBlockHeader interface.
    • BlockHeader became to implement BlockHeader interface.
  • Added BlockMetadataExtensions static class. [#1164, #1492]
  • Added BlockContentExtensions static class. [#1164, #1492]
  • Added BlockMarshaler static class. [#1164, #1492]
  • Added BlockDigest.GetHeader() method. [#1492]
  • Added StateStoreExtensions static class. [#1128, #1146, #1492]
  • Added StoreExtensions.GetStateRootHash() extension method. [#1128, #1146, #1492]
  • Added DelayedRenderer<T>.HashAlgorithmGetter property. [#1492]
  • BlockDigest became to implement IBlockExcerpt. [#1492]
  • Added InvalidBlockPublicKeyException class. [#1457, #1507]
  • Added InvalidBlockSignatureException class. [#1457, #1507]

Behavioral changes

  • Block<T>.Transactions property is now ordered by Transaction<T>.Id so that it's consistent with IBlockContent<T>'s other implementations. As this behavior can be changed in the later releases, do not depend on its ordering, but explicitly sort them before use when the order needs to b guaranteed. [#1492]
  • Blocks and block metadata became to have their miners' public keys too. Although it is backward compatible to the earlier protocol version than 2, blocks with the protocol version 2 or later must have public keys. If a block lacks public key, InvalidBlockPublicKeyException is thrown. [#1457, #1507]
  • PublicKey.ToString() method now returns its hexadecimal representation in compressed form. [#1507]

Bug fixes

  • Fixed NullReferenceException that PublicKey.Verify() method had thrown with a non-null empty signature. [#1507]
  • Fixed TxExecution not updating during preload. [#1508, #1509]
libplanet - Libplanet 0.17.0

Published by github-actions[bot] about 3 years ago

Released on September 28, 2021.

Backward-incompatible API changes

  • Added StateCompleterSet<T>.ComplementAll property. [#1358, #1386]
  • Added StateCompleterSet<T>.ComplementLatest property. [#1358, #1386]
  • BlockPerception now implements IBlockExcerpt interface. [#1440]
    • BlockPerception.Excerpt property removed.
  • TotalDifficultyComparer now implements IComparer<IBlockExcerpt> interface. [#1442]
  • Return type for BlockDemandTable.Add() is now void. [#1435, #1443]
  • Added BlockInsufficientTxsException. [#1445]
  • PrivateKey() constructor's parameter type became IReadOnlyList<byte> (was byte[]). [#1464]
  • PrivateKey.ByteArray property's type became ImmutableArray<byte> (was byte[]). To get a mutable one, use PrivateKey.ToByteArray() method instead. [#1464]
  • PublicKey() constructor's parameter type became IReadOnlyList<byte> (was byte[]). [#1464]
  • PublicKey.Verify() method's both parameter types became IReadOnlyList<byte> (were both byte[]). [#1464]
  • HashDigest<T>.DeriveFrom() method's parameter type became IReadOnlyList<byte> (was byte[]). [#1464]
  • IBlockPolicy<T>.GetMaxBlockBytes() description changed for 0 and negative values. [#1449, #1463]
    • Returned values from these will now be taken literally by BlockChain<T>.
  • Removed IBlockPolicy<T>.MaxTransactionsPerBlock property. It is replaced by IBlockPolicy<T>.GetMaxTransactionsPerBlock(long index) method. [#1447]
  • Added IBlockPolicy<T>.GetMaxTransactionsPerBlock(long index) method. [#1447]
  • Added IBlockPolicy<T>.GetMinTransactionsPerBlock(long index) method. [#1479]
  • Added IBlockPolicy<T>.GetMaxTransactionsPerSignerPerBlock(long index) method. [#1449, #1463]
  • Unused parameter currentTime removed from BlockChain<T>.Append(). [#1462, #1465]
  • Added an optional maxTransactionsPerSigner parameter to BlockChain<T>.MineBlock() method. [#1449, #1463]
  • Added an optional txPriority parameter to BlockChain<T>.MineBlock() method. [#1477]
  • BlockHeader's properties are now represented as richer types than before. [#1470]
    • BlockHeader.Timestamp property's type became DateTimeOffset (was string).
    • BlockHeader.Nonce property's type became Nonce (was ImmutableArray<byte>).
    • BlockHeader.Miner property's type became Address (was ImmutableArray<byte>).
    • BlockHeader.PreviousHash property's type became BlockHash? (was ImmutableArray<byte>).
    • BlockHeader.TxHash property's type became HashDigest<SHA256>? (was ImmutableArray<byte>).
    • BlockHeader.Hash property's type became BlockHash (was ImmutableArray<byte>).
    • BlockHeader.StateRootHash property's type became HashDigest<SHA256>? (was ImmutableArray<byte>).
    • Removed BlockHeader(int, long, string, ImmutableArray<byte>, ImmutableArray<byte>, long, BigInteger, ImmutableArray<byte>, ImmutableArray<byte>, ImmutableArray<byte>, ImmutableArray<byte>, ImmutableArray<byte>) constructor. Use BlockHeader(int, long, DateTimeOffset, Nonce, Address, long, BigInteger, BlockHash?, HashDigest<SHA256>?, BlockHash, ImmutableArray<byte>, HashDigest<SHA256>?) constructor instead.
  • IStore, IStateStore, and IKeyValueStore interfaces now inherit IDisposable. [#1448, #1474]
  • Multiple changes for IBlockPolicy<T> interface. [#1485]
    • bool DoesTransactionFollowsPolicy(BlockChain<T>, Transaction<T>) changed to TxPolicyViolationException? ValidateNextBlockTx( BlockChain<T>, Transaction<T>).
    • InvalidBlockException ValidateNextBlock(BlockChain<T>, Block<T>) changed to BlockPolicyViolationException? ValidateNextBlock( BlockChain<T>, Block<T>).
    • BlockPolicy<T>, the default implementation for IBlockPolicy<T>, has been updated accordingly.
  • Removed BlockPolicy<T>() constructor with int blockIntervalMilliseconds parameter. Use the one with TimeSpan? blockInterval instead. [#1485]
  • Replaced int maxBlockBytes and int maxGenesisBytes parameters from BlockPolicy<T>() constructor with Func<long, int>? getMaxBlockBytes. [#1485]
  • Removed TxViolatingBlockPolicyException class. [#1485]
  • Optional parameter name difficultyBoundDivisor for BlockPolicy<T>() constructor changed to difficultyStability. [#1495]
  • Type for optional parameter difficultyStability for BlockPolicy<T>() constructor changed to long? from int?. [#1495]

Backward-incompatible network protocol changes

  • Message became to serialize peer with Bencodex instead of BinaryFormatter. [#1455]

Added APIs

  • IBlockExcerpt.ExcerptEquals extension method added. [#1440]
  • Added PrivateKey.FromString() method. [#1475]
  • Added PrivateKey.Sign(ImmutableArray<byte>) overloaded method. [#1464]
  • Added PrivateKey.Decrypt(ImmutableArray<byte>) overloaded method. [#1464]
  • Added PrivateKey.ToByteArray() method. [#1464]
  • Added PublicKey.Encrypt(ImmutableArray<byte>) overloaded method. [#1464]
  • Added PublicKey.ToImmutableArray() method. [#1464]
  • Added Nonce(ImmutableArray<byte>) overloaded constructor. [#1464]
  • Added HashAlgorithmType.Digest(IEnumerable<byte[]>) overloaded method. [#1480]
  • Added HashAlgorithmType.Digest(IEnumerable<ImmutableArray<byte>>) overloaded method. [#1480]
  • Added BlockHeader(int, long, DateTimeOffset, Nonce, Address, long, BigInteger, BlockHash?, HashDigest<SHA256>?, BlockHash, ImmutableArray<byte>, HashDigest<SHA256>?) constructor. [#1470]
  • Added TxCompletion<TPeer, TAction> class. [#1420, #1478]
  • Added BlockPolicyViolationException and TxPolicyViolationException classes. [#1485]
  • Added DifficultyAdjustment static class. [#1495]
  • Added BlockPolicy<T>.DifficultyStability and BlockPolicy<T>.MinimumDifficulty properties. [#1495]

Behavioral changes

  • StateCompleterSet<T>.Recalculate now evaluates states even for those already in IStateStore. Moreover, it also terminates early if possible after reaching the BlockHash provided with a call. [#1358, #1386]
  • TotalDifficultyComparer no longer considers perceived time when comparing IBlockExcerpts. [#1442]
  • General logic for determining the canonical chain has been updated. [#1435, #1443]
    • Perceived time is only used for marking a received header in BlockDemandTable in order to decide whether BlockDemand is stale or not. This should prevent a tip regression for a local node, as the tip of a chain is never considered as stale.
  • Block sync using BlockDemand became not to fill blocks from multiple peers. [#1459]
  • BlockChain<T>.MineBlock() now uses maxTransactions literally. [#1449, #1463]
    • Before, maxTransactions were internally automatically set to a value between 1 and BlockChain<T>.Policy.MaxTransactionsPerBlock.
  • Similarly, BlockChain<T>.MineBlock() now internally uses BlockChain<T>.Policy.GetMaxBlockBytes() literally. [#1449, #1463]
  • NetMQTransport became to no more send CreatePermission to TURN client and require permission-less TURN server. See coturn's relevant configuration as well. [#1423]
  • Swarm<T> became to sync transactions from multiple peers at the same time. [#1420, #1478]

Bug fixes

  • Improper sanity checks for targetBlockInterval (changed from the old name blockInterval), minimumDifficulty, and difficultyStability (changed from the old name difficultyBoundDivisor) arguments given to BlockPolicy<T>() constructor fixed. [#1495]
    • It was possible for targetBlockInterval to be zero, which would result in division by zero, when this makes no sense.
    • It was possible for difficultyStability not to be positive when this makes no sense.
    • Wrongly threw an ArgumentOutOfRangeException for the case where minimumDifficulty would equal difficultyStability.
    • It was possible for minimumDifficulty to be zero, which would allow difficulty to be stuck at zero indefinitely, when this does not make sense.