Skip to content

Releases: planetarium/libplanet

Libplanet 0.18.0

13 Oct 06:47
0.18.0
8ee2184
Compare
Choose a tag to compare

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 `Bl...
Read more

Libplanet 0.17.0

28 Sep 08:14
0.17.0
26f0797
Compare
Choose a tag to compare

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]
  • `BlockCha...
Read more

Libplanet 0.15.4

15 Sep 05:39
686add3
Compare
Choose a tag to compare

Released on September 14, 2021.

  • Fixed a bug where BlockChain<T>.MineBlock() had created a block that includes both transactions when there are two or more transactions with the same nonce on the stage. [#1491]

Libplanet 0.15.3

10 Sep 07:52
8bda0a1
Compare
Choose a tag to compare

Released on September 10, 2021.

  • Fixed a bug where Swarm<T> fails to reply transaction when any of the requested transactions id in GetTxs message does not exist in the storage. [#1481]

Libplanet 0.15.1

27 Aug 18:18
0.15.1
61fb4ac
Compare
Choose a tag to compare

Released on August 28, 2021.

  • NetMQTransport became to process message in non blocking way. [#1451]

Libplanet 0.16.0

25 Aug 06:26
71be30e
Compare
Choose a tag to compare

Released on August 25, 2021.

Backward-incompatible API changes

  • Removed Swarm<T>.BlockDemand property. [#1419, #1425]
  • BlockChain<T>.Tip property is now non-nullable. [#1430]

Added APIs

  • Added BlockDemandTable<T> class. [#1419, #1425]
  • Added Swarm<T>.BlockDemandTable property. [#1419, #1425]
  • Added SwarmOptions.PollInterval property. [#1419, #1425]
  • Added SwarmOptions.MaximumPollPeers property. [#1419, #1425]

Behavioral changes

  • Swarm<T> became to sync blocks from multiple peers. [#1419, #1425]

Bug fixes

  • Fixed a bug where Swarm<T>.PreloadAsync() failed to sync blocks from the peer that has chain with higher difficulty, but lower index. [#1419, #1425]

CLI tools

Libplanet 0.15.0

19 Aug 07:26
0.15.0
4dd1799
Compare
Choose a tag to compare

Released on August 18, 2021.

Backward-incompatible API changes

  • Added IRandom.Seed property. [#1431]

Libplanet 0.14.1

19 Aug 07:17
0.14.1
3335eb2
Compare
Choose a tag to compare

Released on Aug 18, 2021.

  • Added additional tags to logging. [#1433]

Libplanet 0.14.0

05 Aug 12:38
0.14.0
123101a
Compare
Choose a tag to compare

Released on Aug 5, 2021.

Added APIs

  • Added NonblockRenderer<T> class. [#1402, #1422]
  • Added NonblockActionRenderer<T> class. [#1402, #1422]

Libplanet 0.13.2

05 Aug 07:11
dd22711
Compare
Choose a tag to compare

Released on Aug 5, 2021.

  • When a reorg happens, Swarm<T> now broadcasts a reorged chain tip first before rendering. [#1385, #1415]
  • Fixed a bug where TurnClient hadn't been recovered when TURN connection had been disconnected. [#1424]