Releases: planetarium/libplanet
Releases · planetarium/libplanet
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]
Libplanet 0.9.1
Libplanet 0.9.0
Released on April 27, 2020.
Backward-incompatible API changes
BaseStore
class became to implementIDisposable
. [#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 toStunAddressExtensions
. - Renamed
BytesConvertExtension
class toBytesConvertExtensions
. - Renamed
RandomExtension
class toRandomExtensions
. - Renamed
AddressExtension
class toAddressExtensions
. - Renamed
HashDigestExtension
class toHashDigestExtensions
. - Renamed
NetMQFrameExtension
class toNetMQFrameExtensions
. - Renamed
NetMQSocketExtension
class toNetMQSocketExtensions
. - Renamed
SerializationInfoExtension
class toSerializationInfoExtensions
. - Renamed
StoreExtension
class toStoreExtensions
.
- Renamed
- All parameters, fields, property, and method return values that had been represented as an
Int32
became retyped toAppProtocolVersion
. [#266, #815]Swarm()
constructor's parameterappProtocolVersion
becameAppProtocolVersion
(wasInt32
).Peer()
andBoundPeer()
constructors' parameterappProtocolVersion
becameAppProtocolVersion
(wasInt32
).Peer.AppProtocolVersion
property becameAppProtocolVersion
(wasInt32
).DifferentProtocolVersionEventArgs.ExpectedVersion
andDifferentProtocolVersionEventArgs.ActualVersion
properties becameAppProtocolVersion
(wasInt32
).- Removed
DifferentAppProtocolVersionException
class.
Swarm()
constructor'sEventHandler<DifferentProtocolVersionEventArgs> differentVersionPeerEncountered = null
parameter became replaced byDifferentAppProtocolVersionEncountered differentAppProtocolVersionEncountered = null
parameter. [#266, #815]- Added
IEnumerable<PublicKey> trustedAppProtocolVersionSigners = null
parameter toSwarm()
constructor. [#266, #815] - Removed
DifferentProtocolVersionEventArgs
class. [#266, #815] - Removed
createdAt
parameter fromSwarm()
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 number0x05
) was replaced by a newBlockHashes
message type (with type number0x0e
) 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 ofAppProtocolVersion
, which is newly introduced. [#266, #815]- The existing
RecentStates
message type (with the type number0x0c
) was replaced by a newRecentStates
message type (with type number0x0f
) in order to compress its states. [#700, #850]
Added APIs
- Added
AddressExtensions.ToAddress(this PrivateKey)
overloaded extension method. [#825] - Added
BlockHashDownloadState
class, a subclass ofPreloadState
. [#707, #798] - Added
BlockVerificationState
class, a subclass ofPreloadState
. [#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()
andSwarm<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 sameBlock<T>
s orTransaction<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 ifcancellationToken
was requested. [#798] - Fixed a bug where
Swarm<T>
had crashed if it received invalidTransaction<T>
from the nodes. [#820] - Fixed a bug where
Swarm<T>
hadn't reportedIProgress<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 apassphrase
containing any non-ASCII characters was passed toPbkdf2.Derive()
method orProtectedPrivateKey.Protect()
method. [#845]
CLI tools
- Added the
planet
command and its aliasdotnet planet
.
Libplanet 0.8.0
Released on February 4, 2020.
Backward-incompatible API changes
- The internal representation for state keys became
string
(wasAddress
). [#368, #774]- The return type of
IStore.GetBlockStates()
method becameIImmutableDictionary<string, IValue>
(wasAddressStateMap
, which was removed too). [#368, #774] - The type of the second parameter of
IStore.SetBlockStates()
method becameIImmutableDictionary<string, IValue>
(wasAddressStateMap
, which was removed too). [#368, #774] - The second parameter of
IStore.IterateStateReferences()
method becamestring key
(wasAddress address
). [#368, #774] - The second parameter of
IStore.StoreStateReference()
method becameIImmutableSet<string> keys
(wasIImmutableSet<Address> addresses
). [#368, #774] IStore.ListAddresses()
method was replaced byIStore.ListStateKeys()
method. [#368, #774]
- The return type of
- Added
Swarm<T>.FindSpecificPeer()
method to find a specific peer given the address. [#570, #580] - Removed
LiteDBStore
class. UseDefaultStore
instead. [#662] - Removed
BlockChain<T>.Contains(TxId)
method. UseIStore.ContainsTransaction(TxId)
instead. [#676] - Renamed
BlockChain<T>.Contains(HashDigest<SHA256>)
method toBlockChain<T>.ContainsBlock(HashDigest<SHA256>)
. [#678] - Removed
BlockChain<T>.Contains(Block<T>)
method. [#678] - Changed semantics of
BlockChain<T>.ContainsBlock(HashDigest<SHA256>)
method andBlockChain<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 becameIValue
(wasAddressStateMap
). - The return type of
IStore.GetBlockStates()
method becameIImmutableDictionary<string, IValue>
(wasAddressStateMap
). IStore.SetBlockStates()
method became to takeIImmutableDictionary<string, IValue>
instead ofAddressStateMap
.
- The return type of
Swarm<T>.PreloadAsync()
method andSwarm<T>.StartAsync()
method became to takepreloadBlockDownloadFailed
event handler as an argument. [#694]- Added the
genesisBlock
parameter toBlockChain<T>()
constructor. [#688] - Removed
StateReferenceDownloadState
class. [#703] - Removed
BlockStateDownloadState
class. [#703] - Removed
TxReceived
andBlockReceived
AsyncAutoResetEvent
s fromSwarm<T>
. [#705, #725] - Added
workers
optional parameter intoSwarm<T>()
constructor. [#613, #727] Block<T>
class became not to implementISerializable
. [#751]Transaction<T>
class became not to implementISerializable
. [#751]Block<T>.ToBencodex()
became to returnBencodex.Types.Dictionary
. [#751]Transaction<T>.ToBencodex()
became to returnBencodex.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 byIStore.LookupStateReference<T>()
method. [#722, #774]
Backward-incompatible network protocol changes
- Added
long
-typedoffset
parameter toRecentStates
andGetRecentStates
messages. [#703] - Added
int
-typediteration
parameter toRecentStates
message. [#703] - Added
BlockHeaderMessage
message. [#764]
Backward-incompatible storage format changes
- The introduced
DefaultStore
is incompatible at the file-level with theLiteDBStore
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 replaceLiteDBStore
. [#662] - Added
IStore.ListAllStateReferences<T>()
method. [#701, #703] - Added
IStore.ListStateKeys()
method to replaceIStore.ListAddresses()
method. [#368, #774] - Added
IStore.LookupStateReference<T>()
method to replaceStoreExtension.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 inheritsSwarmException
class. [#604, #726] - Added
Swarm<T>.Peers
property which returns an enumerable of peers inSwarm<T>
's routing table. [#739] - Added
Block<T>.Serialize()
method which returnsbyte[]
. [#751] - Added
Transaction<T>.Serialize()
method which returnsbyte[]
. [#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>?
-typedTxHash
property which digests all transactions in the block toBlock<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 aPeer
s stat...
Libplanet 0.7.0
Released on November 8, 2019.
Backward-incompatible interface changes
- Renamed
minValue
/maxValue
parameters tolowerBound
/upperBound
ofIRandom.Next()
methods. [#555, #558] - Renamed
IStore.IterateIndex()
method toIterateIndexes()
. [#462, #560] Swarm<T>
class became to implementIDisposable
again and should be disposed to clean up its internal resources. [#485]IStore.IterateStateReferences()
method became to receivehighestIndex
,lowestIndex
, andlimit
parameters. [#447, #545]- Reworked
BlockChain<T>.GetStates()
intoGetState()
which takes only oneAddress
instead ofIEnumerable<Address>
. [#510, #563] - Types of
IAction.PlainValue
and states became restricted toBencodex.Types.IValue
. [#541, #552]IAction.LoadPlainValue(IImmutableDictionary<string, object>)
method became replaced byLoadPlainValue(IValue)
.AccountStateGetter
became to returnIValue
, notobject
.- Added
BencodexExtension
static class.
- Removed
BlockChain<T>.Blocks
. [#409, #583] - Removed
BlockChain<T>.Transactions
. [#409, #583] - Removed the
linger
parameter from theSwarm<T>()
constructor, and added thewaitFor
parameter toSwarm<T>.StopAsync()
method instead. [#581] - Removed the
dialTimeout
parameter from theSwarm<T>
() constructor, and added it toSwarm<T>.PreloadAsync()
&Swarm<T>.StartAsync()
methods. [#581] - Removed
broadcast
parameter fromBlockChain<T>.MakeTransaction()
method. [#609] BlockChain<T>
does not implementIReadOnlyList<T>
anymore. [#630]- Added
BlockChain<T>.Count
property. [#630] - Removed
BlockChain<T>.LongCount()
method. [#630] - Removed
BlockChain<T>.Validate()
method. [#630] - Removed
BlockChain<T>.GetEnumerate()
method. [#630] - Removed
BlockPolicyExtension.ValidateBlocks()
method. [#630] IBlockPolicy<T>.GetNextBlockDifficulty()
method became to receiveBlockChain<T>
instead ofIReadOnlyList<Block<<T>>
. [#630]IBlockPolicy<T>.ValidateNextBlock()
method became to receiveBlockChain<T>
instead ofIReadOnlyList<Block<<T>>
. [#630]
- Added
Added interfaces
- Added
ProtectedPrivateKey
class. [#577, #614] - Added
IncorrectPassphraseException
class. [#577, #614] - Added
MismatchedAddressException
class. [#577, #614] - Added
KeyJsonException
abstract class. [#577, #614] - Added
InvalidKeyJsonException
class. [#577, #614] - Added
UnsupportedKeyJsonException
class. [#577, #614] - Added
ICipher
interface. [#577, #614] - Added
Aes128Ctr
class. [#577, #614] - Added
IKdf
interface. [#577, #614] - Added
Pbkdf2
class. [#577, #614] - Added
Scrypt
class. [#642, #654] - Added
BlockChain<T>.LongCount()
method. [#575] - Added
BlockChain<T>[HashDigest<T>]
indexer. [#409, #583] - Added
BlockChain<T>.Contains(HashDigest<T>)
method. [#409, #583] - Added
BlockChain<T>.GetTransaction(TxId)
method. [#409, #583] - Added
BlockChain<T>.Contains(TxId)
method. [#409, #583] - Added
ByteUtil.Hex(ImmutableArray<byte>)
overloaded method. [#614] - Added
BlockChain<T>.Contains(Block<T>)
method. [#630] - Added
BlockDownloadState.SourcePeer
property. [#636]
Behavioral changes
- Changed to send
Pong
before updating the message sender to the routing table whenPing
is received. [#566] - Improved performance of
StoreExtension.LookupStateReference<T>()
method. [#447, #545] - Added .NET Core 2.2 as a targeted framework. [#209, #561]
TurnClient.AcceptRelayedStreamAsync()
became to ignore disconnected connections. [#469]Swarm<T>.PreloadAsync()
became to ignore peers with lower tip. [#592]Swarm<T>
became to validate only stale peers. [#568, #593]Swarm<T>
became not to check cached peers immediately after removing peers from its routing table. Instead, it checks cached peers periodically. [#608]- Marked
Address
andHashDigest
as readonly. [#610] IceServer.CreateTurnClient()
became to throwArgumentException
when received invalid url. [#622]Swarm<T>
became to update peer table when receiving messages that are not related with Kademlia protocol. [#594, #627]Swarm<T>
became not to check least recently used peer every time when new peer is fetched. [#627]IAction
became guaranteed that the givenIActionContext.PreviousStates.GetState()
never throwsIncompleteBlockStatesException
. Instead, now it may calculate the incomplete states from the beginning if necessary. [#645]IStore.PutBlock<T>()
became to do nothing when it takes theBlock<T>
more than once. [#647]Swarm<T>.PreloadAsync()
became to try downloading blocks from all neighbor peers, even if any peer among them is unavailable to send blocks. [#636]
Bug fixes
- Fixed a bug where
Swarm<T>
had tried to update a peer infinitely when the peer is evicted from its table. [#566] - Fixed a bug where
Swarm<T>.AppendBlocksAsync()
re-requests blocks that already received when blockchain is empty. [#550, #562] - Fixed a bug that
Swarm<T>
had thrownSocketException
with a messageOperation on non-blocking socket would block
. [#405, #485] - Fixed a bug that accessed all blocks fr...
Libplanet 0.6.0
Released on October 1, 2019.
Backward-incompatible interface changes
BlockChain<T>.MineBlock()
is nowasync
and became to throwOperationCanceledException
ifBlockChain<T>
's tip index is changed while mining. [#460, #517]- Users became able to give a cancellation token to
Block<T>.Mine()
andHashcash.Answer()
to cancel the operation. [#460, #517] - Replaced
UnexpectedlyTerminatedTxRehearsalException
withUnexpectedlyTerminatedActionException
. [#498] - The following methods became to throw
UnexpectedlyTerminatedActionException
with having itsInnerException
during actions being evaluated if any action of them throws an exception: [#498]Transaction<T>.EvaluateActions()
Transaction<T>.EvaluateActionsGradually()
Block<T>.EvaluateActionsPerTx()
Block<T>.Evaluate()
BlockChain<T>.GetStates(completeStates: true)
- The concept of "namespaces" in
IStore
was replaced by "chain IDs" to be consistent withBlockChain<T>
. [#483, #486]- Renamed
IStore.ListNamespaces()
method toListChainIds()
. - Renamed
IStore.DeleteNamespace()
method toDeleteChainId()
. - Renamed
IStore.GetCanonicalNamespace()
method toGetCanonicalChainId()
. - Renamed
IStore.SetCanonicalNamespace(string)
method toSetCanonicalChainId(Guid)
. - Replaced
namespace
/sourceNamespace
/destinationNamespace
parameters takingstring
of methods inIStore
andStoreExtension
withchainId
/sourceChainId
/destinationChainId
takingGuid
. - Renamed
NamespaceNotFoundException
toChainIdNotFoundException
. - Replaced
NamespaceNotFoundException(string, string)
constructor withChainIdNotFoundException(Guid, string)
constructor. - Replaced
NamespaceNotFoundException.Namespace
property withChainIdNotFoundException.ChainId
property.
- Renamed
IStore.StoreStateReference<T>(string, IImmutableSet<Address>, Block<T>)
method became replaced byStoreStateReference(Guid, IImmutableSet<Address>, HashDigest<SHA256>, long)
method so that it takes hash and index of a block instead of an entire block. [#420]- Added
IStore.ForkBlockIndexes()
method. [#420] - Removed
addressesToStrip
parameter fromIStore.ForkStateReferences<T>()
method. [#454, #467, #509, #522] - Removed the concept of "staged transactions that should not be broadcasted," because its primary usage had been to make a transaction of a reward action for a candidate for block miner, and the case became achieved through
IBlockPolicy<T>.BlockAction
property which was introduced at 0.5.0. All staged transactions became broadcasted. [#319, #470]BlockChain<T>.StageTransactions(IDictionary<Transaction<T>, bool>)
method became replaced byStageTransactions(IImmutableSet<Transaction<T>>)
.- Removed
toBroadcast
parameter fromIStore.IterateStagedTransactionIds(bool)
method. IStore.StageTransactionIds(IDictionary<TxId, bool>)
method became replaced byStageTransactionIds(IImmutableSet<TxId>()
.
- Removed
Swarm<T>.AddPeersAsync()
method. To connect with seed peers, useSwarm<T>.BootstrapAsync()
method instead. [#353] Peer
with endpoints should be typed asBoundPeer
which is inherited fromPeer
. [#353]- Removed
IActionContext.NewGuid()
method. To get a randomly generated Guid, useRandomExtension.GenerateRandomGuid()
which implements RFC 4122 instead. [#508]
Added interfaces
- Added
BlockChain<T>.TipChanged
event which is invoked with an argument ofBlockChain<T>.TipChangedEventArgs
whenBlockChain<T>.Tip
is changed. [#517, #526] - Added
BlockChain<T>.TipChangedEventArgs
class. [#526] - Added
Swarm<T>.BootstrapAsync()
method to connect with seed peers. [#353] - Added
RandomExtension
static class. [#508] TxId
class became to implementIComparable<TxId>
andIComparable
interfaces. [#244, #511]
Behavioral changes
Swarm<T>
now broadcasts transactions as soon as new transactions are received. [#463, #496]Swarm<T>
now ignores block hashes which already exists. [#461, #484]Swarm<T>.PreloadAsync()
method became to download precalculated states of blocks from a likely branchpoint instead of a genesis block from a trusted peer (i.e.,trustedStateValidators
) where there are branches between peers. [#465, #481]Swarm<T>
's internalGetRecentStates
message became to takeBlockLocator
, an internal data type to approximates a path of a chain of blocks for heuristics to search a likely branchpoint, instead ofHashDigest<SHA256>
. [#465, #481]- NetMQ instances are now initialized at
Swarm<T>.StartAsync()
instead ofSwarm<T>()
. [#353] - Peers now connected via Kademlia protocol. Peers are now selectively connected to each peer. [#353]
TxId
s andBlock
s are now broadcasted to selected peers from routing table of the host peer. [#353]PolymorphicAction<T>.ToString()
method became to show the runtime type of itsInnerAction
for the sake of easier debugging. [#512]- The order of
Block<T>.Transactions
became to be determined by both aBlock<T>.Hash
and aTransaction<T>.Id
, so that signers cannot predict the order of transactions in a block before it's mined. If there are multiple transactions signed by the same signer in a block these transactions become grouped together and the order is determined by aBlock<T>.Hash
and a fingerprint derived from all these transactions, and transactions in each group (per signer) are ordered byTransaction<T>.Nonce
. [#244, #355, #511, #520] LiteDBStore()
became to create the database in memory if thepath
parameter isnull
. [#521]
Bug fixes
- Fixed a bug that
Swarm<T>
hadn't released its TURN related resources onSwarm<T>.StopAsync()
. [#450] - Fixed a bug that
IActionContext.Random
had been possible to generated equivalent results between actions of different transactions in aBlock<T>
. [#519] - Fixed a bug where a forked chain would not be deleted when an exception occurred during fetching block from other peers. [#527, #537, #540]
Libplanet 0.5.3
Released on September 9, 2019.
Bug fixes
- Fix bug where
IAccountStateDelta.GetState()
hadn't returned proper state when the block action is evaluated. [#500]
Libplanet 0.5.2
Released on August 29, 2019.
Bug fixes
- Fixed a bug that
Swarm<T>.PreloadAsync()
method had thrownLiteException
(or other exception depending onIStore
), which indicates a state reference is duplicate, wheretrustedStateValidators
is present and a miner tries to download precalculated states from a trusted peer. [#465, #474] - Fixed a bug tag
Swarm<T>.StartAsync()
sometimes had thrown an exception fromIStore
(e.g.,NullReferenceException
) during broadcasting transactions. [#352, #476]