Releases: planetarium/libplanet
Releases · planetarium/libplanet
Libplanet 0.11.1
Released on April 22th, 2021.
- Fixed a bug where block synchronization had stopped due to internal errors. [#1259]
Libplanet 0.11.0
Released on March 30, 2021.
Backward-incompatible API changes
- Added the parameter
protocolVersion
toBlock<T>(long, long, BigInteger, Nonce, Address?, HashDigest<SHA256>?, DateTimeOffset, IEnumerable<Transaction<T>> transactions, HashDigest<SHA256>?, HashDigest<SHA256>?)
constructor. [#1142, #1147, #1162] - Added the parameter to
protocolVersion
toBlock<T>.Mine()
method. [#1142, #1147, #1162] - Added the first parameter
protocolVersion
toBlockHeader()
constructor. [#1142, #1147, #1162] - Added
stagePolicy
as the second parameter toBlockChain<T>()
constructor. [#1130, #1131] - Added
IBlockPolicy<T>.CanonicalChainComparer
property to make the canonical chain. [#1155, #1165, #1184] - Added
canonicalChainComparer
as the last parameter toBlockPolicy()
constructors. [#1155, #1165, #1184] - Added
canonicalChainComparer
as the second parameter toDelayedRenderer()
constructor. [#1155, #1165, #1184] - Added
canonicalChainComparer
as the second parameter toDelayedActionRenderer()
constructor. [#1155, #1165, #1184] - Added
reorgResistantHeight
parameter intoDelayedActionRenderer<T>()
constructor. [#1163] - Added
IStore.SetBlockPerceivedTime()
method. [#1184] - Added
IStore.GetBlockPerceivedTime()
method. [#1184] - Removed
TransactionSet<T>
class. [#1165] - Removed
IBlockStatesStore
interface. [#1117] - Removed
BaseBlockStatesStore
abstract class. [#1117] - Removed
Swarm<T>.GetTrustedStateCompleterAsync()
method. [#1117] - Removed
trustedStateValidators
parameter fromSwarm<T>.PreloadAsync()
method. [#1117] - Removed
Swarm<T>.TraceTable()
method. [#1120] - Added
IActionContext.BlockAction
property. [#1143] - Added nullable
TimeSpan
-typedmessageLifespan
parameter intoNetMQTransport()
constructor. [#1171] - Added
IStore.ForkTxNonces()
method. [#1198] - Removed
PeerState.Address
Property. [#1215] IProtocol.RebuildConnectionAsync(CancellationToken)
method was replaced by,IProtocol.RebuildConnectionAsync(int, CancellationToken)
method. [#1215]
Backward-incompatible network protocol changes
Swarm<T>
became no longer retry whenSwarm<T>
receives less than 500 blocks. [#1112]- The existing
ChainStatus
message type (with the type number0x24
) was replaced by a newChainStatus
message type (with the type number0x25
). [#1155, #1165] - Removed the message types depended on features of
IBlockStatesStore
interface. [#1117]GetRecentStates
message type (with the type number0x0b
)RecentStates
message type (with the type number0x13
)GetBlockStates
message type (with the type number0x22
)BlockStates
message type (with the type number0x23
)
Swarm<T>
became to ignore messages made earlier than a certain amount of time, which is configured bySwarmOptions.MessageLifespan
. [#1160, #1171]
Backward-incompatible storage format changes
- (Libplanet.RocksDBStore) The blocks and transactions became stored in multiple databases. Each block and transaction belongs to a partition of the database, according to its epoch unit, which is its Unix timestamp. Every epoch is divided by certain seconds, configured by
RocksDBStore()
constructor'stxEpochUnitSeconds
andblockEpochUnitSeconds
parameters (86400 by default). [#1183, #1194] - (Libplanet.RocksDBStore) Continue on partitioning of database,
RocksDBStore()
is manage database connection by LRU Cache. The max size of connection cache is configured byRocksDBStore()
constructor'sdbConnectionCacheSize
parameters (100 by default). [#1183, #1194] - (Libplanet.RockDBStore) The
RocksDBStore
that was previously used has been separated into a class calledMonoRocksDBStore
. Please use this class if you need to migrate. [#1183, #1204]
Added APIs
- Added
Block<T>.CurrentProtocolVersion
constant. [#1142, #1147] - Added
Block<T>.ProtocolVersion
property. [#1142, #1147] - Added
Block<T>.Header
property. [#1070, #1102] - Added
BlockHeader.ProtocolVersion
property. [#1142, #1147] - Added
IBlockExcerpt
interface. [#1155, #1165, #1170] - Added
BlockExcerpt
static class. [#1155, #1165, #1170, #1184] Block<T>
became to implementIBlockExceprt
interface. [#1155, #1165, #1170]BlockHeader
became to implementIBlockExceprt
interface. [#1155, #1165, #1170]- Added
BlockPerception
struct. [#1155, #1184] - Added
BlockChain<T>.PerceiveBlock()
method. [#1155, #1184] - Added
DelayedRenderer<T>.CanonicalChainComparer
andDelayedActionRenderer<T>.CanonicalChainComparer
properties. [#1155, #1165, #1184] - Added
TotalDifficultyComparer
class. [#1155, #1165, #1170, #1184] - Added
IStagePolicy<T>
interface. [#1130, #1131, #1186] - Added
VolatileStagePolicy<T>
class. [#1130, #1131, #1136, #1186] - Added
ITransport
interface. [#1052] - Added ...
Libplanet 0.10.3
Libplanet 0.10.2
Released on November 25, 2020.
- Fixed
BlockChain<T>.Append()
method's bug that it had accepted aBlock<T>
having moreTransactions
than the number specified by theIBlockPolicy<T>.MaxTransactionsPerBlock
property. Now it throwsInvalidBlockException
instead for such case. [#1104]
Libplanet 0.10.1
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 ofIBlockStatesStore
. [#1063]- Fixed a bug where
Swarm<T>.GetPeerChainStateAsync()
has thrownNullReferenceException
when peers in table does failed to respond. [#1066] - Fixed a bug where
BlockChain<T>
had not locked readers–writer lock for state changes duringMineBlock()
. [#1077, #1087] PolymorphicAction<T>.ToString()
became more human-readable. [#1085, #1087]- Fixed a bug where
MerkleTrie
had hadMrrkleTrie.EmptyRootHash
as root node, which had been unable to insert new nodes. [#1087, #1091]
Libplanet 0.10.0
Released on October 27, 2020.
Backward-incompatible API changes
- Extracted rendering methods from
IAction
toIRenderer<T>
, which is introduced in this version. From now on, rendering logic needs to be injected from outside throughBlockChain<T>.Renderers
, rather thanIAction
s knowing how to render themselves.IRenderer<T>
also unifiedBlockChain<T>.TipChanged
event, and introduced new events likeIActionRenderer<T>.RenderActionError()
,IActionRenderer<T>.RenderBlockEnd()
,IRenderer<T>.RenderReorg()
, andIRenderer<T>.RenderReorgEnd()
. [#860, #875, #959, #963]- Removed
IAction.Render()
method, which was replaced byIActionRenderer<T>.RenderAction()
. - Removed
IAction.Unrender()
method, which was replaced byIActionRenderer<T>.UnrenderAction()
. - Removed
BlockChain<T>.TipChanged
event, which was replaced byIRenderer<T>.RenderBlock()
. - Removed
PolymorphicAction<T>.Render()
andUnrender()
methods. - Removed
BlockChain<T>.TipChangedEventArgs
class.
- Removed
- Added methods related fungible asset states to
IAccountStateDelta
: [#861, #900, #954]UpdatedFungibleAssetsAccounts
propertyMintAsset(Address, Currency, BigInteger)
methodTransferAsset(Address, Address, Currency, BigInteger)
methodBurnAsset(Address, Currency, BigInteger)
methodGetBalance(Address, Currency)
method
- Added
IAccountStateDelta.StateUpdatedAddresses
property in order to distinguish state updates from asset states. [#861, #900] - Added an optional parameter
AccountBalanceGetter accountBalanceGetter
toBlock<T>.EvaluateActionsPerTx()
method. [#861, #900] BlockChain<T>.StageTransaction()
became to throwInvalidTxGenesisHashException
when it takes aTransaction<T>
from a heterogeneousBlockChain<T>
with a different genesis block. [#796, #878]- Added
renderers
optional parameter toBlockChain<T>()
constructor. [#883, #959, #963] - Added
BigInteger
-typedtotalDifficulty
parameter toBlock<T>()
constructor. [#666, #917] - Added
BigInteger
-typedpreviousTotalDifficulty
parameter toBlock<T>.Mine()
static method. [#666, #917] - Added
options
optional parameter toSwarm<T>()
constructor. [#926] ICryptoBackend
became toICryptoBackend<T>
. [#932]ICryptoBackend.Verify(HashDigest<SHA256>, byte[], PublicKey)
became toICryptoBackend<T>.Verify(HashDigest<T>, byte[], PublicKey)
[#932]- Added
ICryptoBackend<T>.Sign(HashDigest<T>, PrivateKey)
method. [#932] DefaultCryptoBackend
became toDefaultCryptoBackend<T>
. [#932]- Added
ImmutableArray<byte>
-typedpreEvaluationHash
parameter toBlockHeader
constructor. [#931, #935] - Added
HashDigest<SHA256>
-typedpreEvaluationHash
parameter toBlock<T>()
constructor. [#931, #935] - Replaced
SerializationInfoExtensions.GetValueOrDefault<T>()
toSerializationInfoExtensions.TryGetValue<T>()
. [#940] - Added
bool append = true
option to bothBlockChain<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 bothBlockChain<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 twoBlockChain<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 toBlockChain<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 bothSwarm<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 withPeer(PublicKey)
constructor. [#949] - Replaced
BoundPeer(PublicKey, DnsEndPoint, AppProtocolVersion)
constructor withPeer(PublicKey, DnsEndPoint)
constructor. [#949] - Extracted
IStore
's some methods dedicated to block states intoIBlockStatesStore
. [#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 toLookupStateReference(Guid, string, long)
. [#950] - Added
IStateStore
-typedstateStore
toBlockChain<T>
constructor. [#950] - Replaced
Swarm<T>.FindSpecificPeerAsync(Address, Address, int, BoundPeer, TimeSpan?, CancellationToken)
method withSwarm<T>.FindSpecificPeerAsync(Address, int, TimeSpan?, CancellationToken)
. [#981] - Added
IActionContext.GetUnconsumedContext()
method. [#980] - Added
ImmutableArray<byte>
-typedstateRootHash
parameter toBlockHeader
constructor. [#986] - Added
HashDigest<SHA256>
-typedstateRootHash
parameter toBlock<T>()
constructor. [#986] - Added
IBlockPolicy<T>.MaxTransactionsPerBlock
property. [#1037, #1050] - Added
IBlockPolicy<T>.GetMaxBlockBytes()
method. [#201, #1050] IBlockPolicy<T>.DoesTransactionFollowPolicy()
method became to take additionalBlockChain<T>
parameter as its context. [#1012]- Methods in
BlockPolicy<T>
class becamevirtual
. [#1010] - Added
int maxTransactionsPerBlock
option to bothBlockPolicy<T>()
overloaded constructors. [#1037, #1050] - Added
int maxBlockBytes
andint maxGenesisBytes
options to bothBlockPolicy<T>()
overloaded constructors. [#201, #1050] BlockPolicy<T>()
constructor'sdoesTransactionFollowPolicy
parameter became `Func<Transaction, BlockChain...
Libplanet 0.9.5
Libplanet 0.9.4
Released on June 2, 2020.
- (Libplanet.RocksDBStore) Fixed a bug that
RocksDBStore.DeleteChainId()
method had thrownKeyNotFoundException
when there's no such chain ID. [#891] - (Libplanet.RocksDBStore) Fixed a bug that
RocksDBStore
had written logs into the incorrect contextDefaultContext
, notRocksDBStore
the correct one. [#891]
Libplanet 0.9.3
Libplanet 0.9.2
Released on May 20, 2020.
- (Libplanet.RocksDBStore) Fixed a memory leak bug in
RocksDBStore
. [#870]