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 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 callpreloadBlockDownloadFailed
event handler taken as an argument. If the event handler is not present,Swarm<T>
throwsSwarmException
. [#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 reportPeerDiscoveryException
instead ofSwarmException
directly. [#604, #726]BlockChain<T>.Append()
became to unstage the stagedTransaction<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 throwInvalidGenesisBlockException
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 callSwarm<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)TimeoutException
s. [#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, andTransaction<T>.ToBencodex()
method had been non-deterministic on someCultureInfo.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 thrownNullReferenceException
whenhost
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 someTransaction<T>
s had become excluded from miningBlock<T>
s after reorg from α to β where aTransaction<T>
was once included by aBlock<T>
(α) and not included by an otherBlock<T>
(β) for the sameIndex
due to the latency gap between nodes. [#775]