Blockchain in C#/.NET for on-chain, decentralized gaming
LGPL-2.1 License
Bot releases are visible (Hide)
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
Released on May 20, 2020.
RocksDBStore
. [#870]
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
Released on April 27, 2020.
BaseStore
class became to implement IDisposable
. [#789]
IStore.DeleteIndex(Guid, HashDigest<SHA256>)
method. [#802]
StunAddressExtension
class to StunAddressExtensions
.BytesConvertExtension
class to BytesConvertExtensions
.RandomExtension
class to RandomExtensions
.AddressExtension
class to AddressExtensions
.HashDigestExtension
class to HashDigestExtensions
.NetMQFrameExtension
class to NetMQFrameExtensions
.NetMQSocketExtension
class to NetMQSocketExtensions
.SerializationInfoExtension
class to SerializationInfoExtensions
.StoreExtension
class to StoreExtensions
.Int32
became retyped to AppProtocolVersion
. [#266, #815]
Swarm()
constructor's parameter appProtocolVersion
became AppProtocolVersion
(was Int32
).Peer()
and BoundPeer()
constructors' parameter appProtocolVersion
became AppProtocolVersion
(was Int32
).Peer.AppProtocolVersion
property became AppProtocolVersion
(was Int32
).DifferentProtocolVersionEventArgs.ExpectedVersion
and DifferentProtocolVersionEventArgs.ActualVersion
properties became AppProtocolVersion
(was Int32
).DifferentAppProtocolVersionException
class.Swarm()
constructor's EventHandler<DifferentProtocolVersionEventArgs> differentVersionPeerEncountered = null
parameter became replaced by DifferentAppProtocolVersionEncountered differentAppProtocolVersionEncountered = null
parameter. [#266, #815]
IEnumerable<PublicKey> trustedAppProtocolVersionSigners = null
parameter to Swarm()
constructor. [#266, #815]
DifferentProtocolVersionEventArgs
class. [#266, #815]
createdAt
parameter from Swarm()
constructor. [#838]
BlockChain<T>.StageTransactions()
with .StageTransaction()
that receives only one transaction. [#820]
BlockChain<T>.UnstageTransactions()
with .UnstageTransaction()
that receives only one transaction. [#820]
IBlockPolicy.DoesTransactionFollowPolicy()
method which is a method to determine if a transaction follows the block policy. [#827]
BlockHashes
message type (with the type number 0x05
) was replaced by a new BlockHashes
message type (with type number 0x0e
) 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 of AppProtocolVersion
, which is newly introduced. [#266, #815]
RecentStates
message type (with the type number 0x0c
) was replaced by a new RecentStates
message type (with type number 0x0f
) in order to compress its states. [#700, #850]
AddressExtensions.ToAddress(this PrivateKey)
overloaded extension method. [#825]
BlockHashDownloadState
class, a subclass of PreloadState
. [#707, #798]
BlockVerificationState
class, a subclass of PreloadState
. [#798]
AppProtocolVersion
struct. [#266, #815]
IKeyStore
interface. [#831]
Web3KeyStore
class. [#831]
BlockDigest
struct. [#785]
BlockHeader
struct. [#785]
IStore.GetBlockDigest(HashDigest<SHA256>)
method. [#785]
Block<T>.ToBlockDigest()
method. [#785]
ByteArrayExtensions
class. [#803]
IStore.PruneBlockStates<T>(Guid, Block<T>)
method. [#790]
DifferentAppProtocolVersionEncountered
delegate. [#266, #815]
Swarm<T>.TrustedAppProtocolVersionSigners
property. [#266, #815]
Peer.IsCompatibleWith()
method. [#266, #815]
TxViolatingBlockPolicyException
class. [#827]
KeyStoreException
class. [#831]
NoKeyException
class. [#831]
BlockChain.MineBlock()
method became to ignore transactions having lower nonce than the expected nonce in the chain. [#791]
Swarm<T>.PreloadAsync()
and Swarm<T>.StartAsync()
became to download only a list of block hashes first and then download blocks from simultaneously multiple peers. [#707, #798]
Swarm<T>
by preventing unnecessary task creation. [#817, #837]
Swarm<T>.PreloadAsync()
by parallelizing connections. [#846]
Swarm<T>
. [#849]
Swarm<T>
became not to sync the same Block<T>
s or Transaction<T>
s multiple times. [#784]
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]
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]
Swarm<T>.PreloadAsync()
method's bug that temporary chain IDs in the store had been completely cleaned up in some corner cases if cancellationToken
was requested. [#798]
Swarm<T>
had crashed if it received invalid Transaction<T>
from the nodes. [#820]
Swarm<T>
hadn't reported IProgress<PreloadState>
s correctly.[#839]
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]
OverflowException
being thrown when a passphrase
containing any non-ASCII characters was passed to Pbkdf2.Derive()
method or ProtectedPrivateKey.Protect()
method. [#845]
planet
command and its alias dotnet planet
.Published by github-actions[bot] over 4 years ago
Released on February 4, 2020.
string
(was Address
). [#368, #774]
IStore.GetBlockStates()
method became IImmutableDictionary<string, IValue>
(was AddressStateMap
, which was removed too). [#368, #774]
IStore.SetBlockStates()
method became IImmutableDictionary<string, IValue>
(was AddressStateMap
, which was removed too). [#368, #774]
IStore.IterateStateReferences()
method became string key
(was Address address
). [#368, #774]
IStore.StoreStateReference()
method became IImmutableSet<string> keys
(was IImmutableSet<Address> addresses
). [#368, #774]
IStore.ListAddresses()
method was replaced by IStore.ListStateKeys()
method. [#368, #774]
Swarm<T>.FindSpecificPeer()
method to find a specific peer given the address. [#570, #580]
LiteDBStore
class. Use DefaultStore
instead. [#662]
BlockChain<T>.Contains(TxId)
method. Use IStore.ContainsTransaction(TxId)
instead. [#676]
BlockChain<T>.Contains(HashDigest<SHA256>)
method to BlockChain<T>.ContainsBlock(HashDigest<SHA256>)
. [#678]
BlockChain<T>.Contains(Block<T>)
method. [#678]
BlockChain<T>.ContainsBlock(HashDigest<SHA256>)
method and BlockChain<T>[HashDigest<SHA256>]
indexer as lookups only the current chain, not entire storage. [#678]
IStore.ContainsBlock(HashDigest<SHA256>)
method. [#678]
AddressStateMap
class. [#98, #368, #692, #774]
BlockChain<T>.GetState()
method became IValue
(was AddressStateMap
).IStore.GetBlockStates()
method became IImmutableDictionary<string, IValue>
(was AddressStateMap
).IStore.SetBlockStates()
method became to take IImmutableDictionary<string, IValue>
instead of AddressStateMap
.Swarm<T>.PreloadAsync()
method and Swarm<T>.StartAsync()
method became to take preloadBlockDownloadFailed
event handler as an argument. [#694]
genesisBlock
parameter to BlockChain<T>()
constructor. [#688]
StateReferenceDownloadState
class. [#703]
BlockStateDownloadState
class. [#703]
TxReceived
and BlockReceived
AsyncAutoResetEvent
s from Swarm<T>
. [#705, #725]
workers
optional parameter into Swarm<T>()
constructor. [#613, #727]
Block<T>
class became not to implement ISerializable
. [#751]
Transaction<T>
class became not to implement ISerializable
. [#751]
Block<T>.ToBencodex()
became to return Bencodex.Types.Dictionary
. [#751]
Transaction<T>.ToBencodex()
became to return Bencodex.Types.Dictionary
. [#751]
Block<T>.FromBencodex(byte[])
method. [#751]
Transaction<T>.FromBencodex(byte[])
method. [#751]
Block<T>.ToBencodex()
became to take no arguments. [#749, #757]
Swarm<T>.BroadcastBlocks(IEnumerable<Block<T>>)
method. [#764]
StoreExtension.LookupStateReference<T>()
method was replaced by IStore.LookupStateReference<T>()
method. [#722, #774]
long
-typed offset
parameter to RecentStates
and GetRecentStates
messages. [#703]
int
-typed iteration
parameter to RecentStates
message. [#703]
BlockHeaderMessage
message. [#764]
DefaultStore
is incompatible at the file-level with the LiteDBStore
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]
DefaultStore
class to replace LiteDBStore
. [#662]
IStore.ListAllStateReferences<T>()
method. [#701, #703]
IStore.ListStateKeys()
method to replace IStore.ListAddresses()
method. [#368, #774]
IStore.LookupStateReference<T>()
method to replace StoreExtension.LookupStateReference<T>()
method. [#368, #722, #774]
BlockChain<T>.Genesis
property. [#688]
BlockChain<T>.MakeGenesisBlock()
static method. [#688]
InvalidGenesisBlockException
class. [#688]
StateDownloadState
class which reports state preloading iteration progress. [#703]
PeerDiscoveryException
class which inherits SwarmException
class. [#604, #726]
Swarm<T>.Peers
property which returns an enumerable of peers in Swarm<T>
's routing table. [#739]
Block<T>.Serialize()
method which returns byte[]
. [#751]
Transaction<T>.Serialize()
method which returns byte[]
. [#751]
Block<T>(Bencodex.Types.Dictionary)
constructor. [#751]
Transaction<T>(Bencodex.Types.Dictionary)
constructor. [#751]
Block<T>.Deserialize(byte[])
method. [#751]
Transaction<T>.Deserialize(byte[])
method. [#751]
StoreExtension.Copy(this IStore, IStore)
extension method. [#753]
HashDigest<SHA256>?
-typed TxHash
property which digests all transactions in the block to Block<T>
class. [#749, #757]
CryptoConfig
class. [#758]
ICryptoBackend
class. [#758]
DefaultCryptoBackend
class. [#758]
Swarm<T>.BroadcastBlock(Block<T>)
method. [#764]
Swarm<T>.PeerStates
property. [#772]
PeerState
class which represents a Peer
s state in the routing table. [#772]
Swarm<T>.CheckAllPeersAsync()
method. [#772]
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]
Swarm<T>.PreloadAsync()
method fails to download blocks, Swarm<T>
became to call preloadBlockDownloadFailed
event handler taken as an argument. If the event handler is not present, Swarm<T>
throws SwarmException
. [#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]
Swarm<T>
's network timeout value, in order to be stable a high latency internet connection. [#709]
Swarm<T>.BootstrapAsync()
became to report PeerDiscoveryException
instead of SwarmException
directly. [#604, #726]
BlockChain<T>.Append()
became to unstage the staged Transaction<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 throw InvalidGenesisBlockException
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 call Swarm<T>.PreloadAsync()
. [#735, #760]
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]
Swarm<T>
chose peers to spread messages has changed. [#765, #767]
Swarm<T>
failed to download blocks due to network connection. [#675]
Swarm<T>
had exhausted all available sockets. [#709]
Swarm<T>
had infinitely repeated failed requests. [#709]
Swarm<T>
hadn't stopped properly. [#709]
Swarm<T>.BootstrapAsync()
had stopped due to trivial (recoverable) TimeoutException
s. [#715, #716]
BlockChain<T>.GetNextTxNonce()
had returned invalid tx nonce. [#718]
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, and Transaction<T>.ToBencodex()
method had been non-deterministic on some CultureInfo.CurrentCulture
(e.g., ar_SA
, fr_FR
, th_TH
) so that it had caused network protocol incompatibilities. [#734]
Swarm<T>.StartAsync()
had thrown NullReferenceException
when host
parameter is present on the outside of NAT. [#744]
Swarm<T>
had failed to request a TURN relay when it has an IPv6 address. [#744]
DefaultStore
had invalid state references cache after fork. [#759]
BlockChain<T>
had rendered and evaluated actions in the genesis block during forking. [#763]
Swam<T>
's bug that some Transaction<T>
s had become excluded from mining Block<T>
s after reorg from α to β where a Transaction<T>
was once included by a Block<T>
(α) and not included by an other Block<T>
(β) for the same Index
due to the latency gap between nodes. [#775]
Published by github-actions[bot] almost 5 years ago
Released on November 8, 2019.
minValue
/maxValue
parameters to lowerBound
/upperBound
of IRandom.Next()
methods. [#555, #558]
IStore.IterateIndex()
method to IterateIndexes()
. [#462, #560]
Swarm<T>
class became to implement IDisposable
again and should be disposed to clean up its internal resources. [#485]
IStore.IterateStateReferences()
method became to receive highestIndex
, lowestIndex
, and limit
parameters. [#447, #545]
BlockChain<T>.GetStates()
into GetState()
which takes only one Address
instead of IEnumerable<Address>
. [#510, #563]
IAction.PlainValue
and states became restricted to Bencodex.Types.IValue
. [#541, #552]
IAction.LoadPlainValue(IImmutableDictionary<string, object>)
method became replaced by LoadPlainValue(IValue)
.AccountStateGetter
became to return IValue
, not object
.BencodexExtension
static class.BlockChain<T>.Blocks
. [#409, #583]
BlockChain<T>.Transactions
. [#409, #583]
linger
parameter from the Swarm<T>()
constructor, and added the waitFor
parameter to Swarm<T>.StopAsync()
method instead. [#581]
dialTimeout
parameter from the Swarm<T>
() constructor, and added it to Swarm<T>.PreloadAsync()
& Swarm<T>.StartAsync()
methods. [#581]
broadcast
parameter from BlockChain<T>.MakeTransaction()
method. [#609]
BlockChain<T>
does not implement IReadOnlyList<T>
anymore. [#630]
BlockChain<T>.Count
property. [#630]
BlockChain<T>.LongCount()
method. [#630]
BlockChain<T>.Validate()
method. [#630]
BlockChain<T>.GetEnumerate()
method. [#630]
BlockPolicyExtension.ValidateBlocks()
method. [#630]
IBlockPolicy<T>.GetNextBlockDifficulty()
method became to receive BlockChain<T>
instead of IReadOnlyList<Block<<T>>
. [#630]
IBlockPolicy<T>.ValidateNextBlock()
method became to receive BlockChain<T>
instead of IReadOnlyList<Block<<T>>
. [#630]
ProtectedPrivateKey
class. [#577, #614]
IncorrectPassphraseException
class. [#577, #614]
MismatchedAddressException
class. [#577, #614]
KeyJsonException
abstract class. [#577, #614]
InvalidKeyJsonException
class. [#577, #614]
UnsupportedKeyJsonException
class. [#577, #614]
ICipher
interface. [#577, #614]
Aes128Ctr
class. [#577, #614]
IKdf
interface. [#577, #614]
Pbkdf2
class. [#577, #614]
Scrypt
class. [#642, #654]
BlockChain<T>.LongCount()
method. [#575]
BlockChain<T>[HashDigest<T>]
indexer. [#409, #583]
BlockChain<T>.Contains(HashDigest<T>)
method. [#409, #583]
BlockChain<T>.GetTransaction(TxId)
method. [#409, #583]
BlockChain<T>.Contains(TxId)
method. [#409, #583]
ByteUtil.Hex(ImmutableArray<byte>)
overloaded method. [#614]
BlockChain<T>.Contains(Block<T>)
method. [#630]
BlockDownloadState.SourcePeer
property. [#636]
Pong
before updating the message sender to the routing table when Ping
is received. [#566]
StoreExtension.LookupStateReference<T>()
method. [#447, #545]
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]
Address
and HashDigest
as readonly. [#610]
IceServer.CreateTurnClient()
became to throw ArgumentException
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 given IActionContext.PreviousStates.GetState()
never throws IncompleteBlockStatesException
. Instead, now it may calculate the incomplete states from the beginning if necessary. [#645]
IStore.PutBlock<T>()
became to do nothing when it takes the Block<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]
Swarm<T>
had tried to update a peer infinitely when the peer is evicted from its table. [#566]
Swarm<T>.AppendBlocksAsync()
re-requests blocks that already received when blockchain is empty. [#550, #562]
Swarm<T>
had thrown SocketException
with a message Operation on non-blocking socket would block
. [#405, #485]
Swarm<T>
had thrown InvalidBlockIndexException
during synchronizing with other reorganized peer. [#528, #576]
Swarm<T>
does not render actions in blocks which are filled from other peers. [#579]
Swarm<T>
renders actions in same block multiple times when reorg happens. [#579]
LiteDBStore
became to guarantee atomicity of storing blocks. [#584]
BlockChain<T>
had appended a block even if fails to evaluate. [#591]
Swarm<T>
hadn't removed stale peers. [#568, #593, #602]
TurnClient
had thrown IOException
when accepting connection through a TURN relay server. [#453, #599]
KeyNotFoundException
occurred when sending a message through the TurnClient.BlockChain<T>.GetNextTxNonce
only returned the same nonce when transactions with an old nonce were staged. [#637]
BlockChain<T>
had reset when Swarm<T>.PreloadAsync()
fails. [#644]
Published by github-actions[bot] about 5 years ago
Released on October 1, 2019.
BlockChain<T>.MineBlock()
is now async
and became to throw OperationCanceledException
if BlockChain<T>
's tip index is changed while mining. [#460, #517]
Block<T>.Mine()
and Hashcash.Answer()
to cancel the operation. [#460, #517]
UnexpectedlyTerminatedTxRehearsalException
with UnexpectedlyTerminatedActionException
. [#498]
UnexpectedlyTerminatedActionException
with having its InnerException
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)
IStore
was replaced by "chain IDs" to be consistent with BlockChain<T>
. [#483, #486]
IStore.ListNamespaces()
method to ListChainIds()
.IStore.DeleteNamespace()
method to DeleteChainId()
.IStore.GetCanonicalNamespace()
method to GetCanonicalChainId()
.IStore.SetCanonicalNamespace(string)
method to SetCanonicalChainId(Guid)
.namespace
/sourceNamespace
/destinationNamespace
parameters taking string
of methods in IStore
and StoreExtension
with chainId
/sourceChainId
/destinationChainId
taking Guid
.NamespaceNotFoundException
to ChainIdNotFoundException
.NamespaceNotFoundException(string, string)
constructor with ChainIdNotFoundException(Guid, string)
constructor.NamespaceNotFoundException.Namespace
property with ChainIdNotFoundException.ChainId
property.IStore.StoreStateReference<T>(string, IImmutableSet<Address>, Block<T>)
method became replaced by StoreStateReference(Guid, IImmutableSet<Address>, HashDigest<SHA256>, long)
method so that it takes hash and index of a block instead of an entire block. [#420]
IStore.ForkBlockIndexes()
method. [#420]
addressesToStrip
parameter from IStore.ForkStateReferences<T>()
method. [#454, #467, #509, #522]
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 by StageTransactions(IImmutableSet<Transaction<T>>)
.toBroadcast
parameter from IStore.IterateStagedTransactionIds(bool)
method.IStore.StageTransactionIds(IDictionary<TxId, bool>)
method became replaced by StageTransactionIds(IImmutableSet<TxId>()
.Swarm<T>.AddPeersAsync()
method. To connect with seed peers, use Swarm<T>.BootstrapAsync()
method instead. [#353]
Peer
with endpoints should be typed as BoundPeer
which is inherited from Peer
. [#353]
IActionContext.NewGuid()
method. To get a randomly generated Guid, use RandomExtension.GenerateRandomGuid()
which implements RFC 4122 instead. [#508]
BlockChain<T>.TipChanged
event which is invoked with an argument of BlockChain<T>.TipChangedEventArgs
when BlockChain<T>.Tip
is changed. [#517, #526]
BlockChain<T>.TipChangedEventArgs
class. [#526]
Swarm<T>.BootstrapAsync()
method to connect with seed peers. [#353]
RandomExtension
static class. [#508]
TxId
class became to implement IComparable<TxId>
and IComparable
interfaces. [#244, #511]
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 internal GetRecentStates
message became to take BlockLocator
, an internal data type to approximates a path of a chain of blocks for heuristics to search a likely branchpoint, instead of HashDigest<SHA256>
. [#465, #481]
Swarm<T>.StartAsync()
instead of Swarm<T>()
. [#353]
TxId
s and Block
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 its InnerAction
for the sake of easier debugging. [#512]
Block<T>.Transactions
became to be determined by both a Block<T>.Hash
and a Transaction<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 a Block<T>.Hash
and a fingerprint derived from all these transactions, and transactions in each group (per signer) are ordered by Transaction<T>.Nonce
. [#244, #355, #511, #520]
LiteDBStore()
became to create the database in memory if the path
parameter is null
. [#521]
Swarm<T>
hadn't released its TURN related resources on Swarm<T>.StopAsync()
. [#450]
IActionContext.Random
had been possible to generated equivalent results between actions of different transactions in a Block<T>
. [#519]
Published by github-actions[bot] about 5 years ago
Released on September 9, 2019.
IAccountStateDelta.GetState()
hadn't returned proper state when the block action is evaluated. [#500]
Published by github-actions[bot] about 5 years ago
Released on August 29, 2019.
Swarm<T>.PreloadAsync()
method had thrown LiteException
(or other exception depending on IStore
), which indicates a state reference is duplicate, where trustedStateValidators
is present and a miner tries to download precalculated states from a trusted peer. [#465, #474]
Swarm<T>.StartAsync()
sometimes had thrown an exception from IStore
(e.g., NullReferenceException
) during broadcasting transactions. [#352, #476]
Published by github-actions[bot] about 5 years ago
Released on August 28, 2019.
ArgumentNullException
had been thrown when a blockchain, which consists of incomplete states (i.e., precalculated states downloaded from trusted peers), encounters a new branch so that reorg is made. [#454, #466]
Published by github-actions[bot] about 5 years ago
Released on August 22, 2019.
IStore.GetBlockIndex()
method. [#385]
StoreExtension.LookupStateReference<T>()
method became to return Tuple<HashDigest<SHA256>, long>
which is a nullable tuple of Block<T>.Hash
and Block<T>.Index
. [#350]
IBlockPolicy<T>.BlockAction
property. [#319, #367]
ActionEvaluation
. [#319, #367]
ActionEvaluation.Action
became to IAction
type. [#319, #367]
LiteDBStore()
constructor became to have a new option named flush
and turned on by default. [#387, LiteDB #1268]
LiteDBStore()
constructor became to have a new option named readOnly
and turned off by default. [#434]
BaseIndex.ContainsKey()
method became abstract
. [#390]
BlockDownloadState.TotalBlockCount
and BlockDownloadState.ReceivedBlockCount
became to Int64
type. [#396, #399]
IStore.IterateIndex()
method became to receive offset
and limit
parameters. [[#425]]
IStore.GetCanonicalNamespace()
method. [#426]
IStore.SetCanonicalNamespace()
method. [#426]
IRandom.NextDouble()
method, because floating-point arithmetics, which is underspecified, likely introduce indeterminism. [#410, #419]
IActionContext.NewGuId()
method. [#371, #439]
Address(byte[])
became to throw ArgumentNullException
instead of NullReferenceException
. [#443]
FileStore
class. [#446]
trustedStateValidators
option to Swarm<T>.PreloadAsync()
method. If any peer in this set is reachable and there is no built up blockchain in a current node, Swarm<T>
receives the latest states of the major blockchain from that trusted peer, which is also calculated by that peer, instead of autonomously calculating the states from scratch. Note that this option is intended to be exposed to end users through a feasible user interface so that they can decide whom to trust for themselves. [#272, #343]
StoreExtension.ListAllStateReferences(this IStore, string, HashDigest<SHA256>?, HashDigest<SHA256>?)
extension method. [#363, #384, #385]
Address
class became to implement IComparable<Address>
and IComparable
interfaces. [#363]
BlockChain<T>.BlockHashes
property. [#389]
Swarm<T>.PreloadAsync(IProgress<PreloadState>, IImmutableSet<Address>, CancellationToken)
became to report progress for all phases. [#397, #400]
PreloadState
, ActionExecutionState
, StateReferenceDownloadState
, and BlockStateDownloadState
classes to cover all phases in the entire preloading process. [#397, #400]
Address(ImmutableArray<byte>)
constructor. [#442, #443]
BlockChain<T>.PreloadAsync()
method became to omit rendering of IAction
s in the preloaded behind blocks. [#272, #343]
Swarm<T>
became to have two more message types: GetRecentStates
(0x0b
) and RecentStates
(0x0c
). [#272, #343]
BlockChain<T>.MineBlock()
and BlockChain<T>.GetNextTxNonce()
methods became to ignore transactions that didn't follow Transaction<T>.Nonce
sequentially and treat them as pendings. [#365]
BlockChain<T>
became to evaluate IBlockPolicy<T>.BlockAction
and set the state when a block is appended to the chain. [#319, #367]
BlockSet<T>.ContainsKey()
and TransactionSet<T>.ContainsKey()
methods became O(1) time complexity through omitting iteration and relying own retrieve implementations. [#390]
LiteDBStore
stores state references became efficient, but the file-level backward compatibility was also broken. [#395, #398]
Swarm<T>.PreloadAsync()
method became to report a block downloading progress with the total number of blocks to download in the entire batch, instead of the window size of a chunk (i.e., 500). [#396, #399]
Swarm<T>.PreloadAsync()
became to get the first parameter, progress
, which accepts IProgress<PreloadState>
. [#397, #400]
BlockHashes
messages became to contain one more higher hash. [#408, #445]
Swarm<T>.PreloadAsync()
became safe from data corruption even if a preloading process suddenly gets shutdown. [#417]
FileStore
and LiteDBStore
became to guarantee atomicity of storing transactions. [#413]
IStore.PutTransaction<T>()
became to do nothing when it takes the Transaction<T>
more than once. [#413]
BlockChain<T>.Swap()
became to omit common block finding when render
is false
. [#423]
PrivateKey(byte[])
constructor became to check validity. [#438]
LiteDBStore.IterateStagedTransactionIds()
returns duplicated transaction ids. [#366]
NullReferenceException
occurred when serializing default Address
. [#369]
Swarm<T>
to avoid continuous delays in peer registration in some situations. [#375]
TurnClient
had thrown KeyNotFoundException
and IOException
on startup. [#377, #378]
LiteDBStore
bug that blocks or transactions had got corrupted sometimes. Instead, LiteDBStore.GetTransaction()
became possible to return null
even for already stored transactions, and for that case, a warning will be logged through Serilog. [#386, #387, LiteDB #1268]
NetworkStreamProxy.StartAsync()
hadn't stopped properly when the connection had reset by a remote peer. [#414]
Swarm<T>
had hung forever after a remote peer had disconnected while receiving. [#416]
Swarm<T>.PreloadAsync()
had been processed even if there is no appropriate peer. [#418]
Published by github-actions[bot] over 5 years ago
Released on July 11, 2019.
BlockChain<T>.GetStates()
method had not returned the latest state when there are multiple addresses. [#346]
Published by github-actions[bot] over 5 years ago
Released on July 8, 2019.
Peer.AppProtocolVersion
became nullable to represent Peer
whose version is unknown. [#280]
IStore.ListAddresses()
method. [#272, #285]
IStore.ListTxNonces()
method. [#272, #309, #310]
BlockChain<T>.GetNonce()
method. [#294]
BlockChain<T>.StageTransactions
became to receive IDictionary<Transaction<T>, bool>
instead of ISet<Transaction<T>>
. [#274, #297]
IStore.StageTransactionIds()
method became to receive IDictionary<TxId, bool>
instead of ISet<TxId>
. [#274, #297]
IStore.IterateStagedTransactionIds()
method became to receive bool toBroadcast
which is whether to iterate only the TxId set to broadcast. [#274, #297]
Swarm<T>.StartAsync()
method became to receive broadcastTxInterval
(or millisecondsBroadcastTxInterval
) parameter. [#274, #297]
IStore
became to treat a "tx nonce" mere a long
integer instead of a stack of block hashes. [#272, #307, #309, #310]
IStore.IncreaseTxNonce<T>(string, Block<T>)
method was replaced by IStore.IncreaseTxNonce(string, Address, long)
method.IStore.ForkTxNonce()
method.FileStore
became to occupy fewer bytes for storing tx nonces. This change broke file-level backward compatibility.IStore
became possible to look up multiple state references in a stack. [#272, #307]
IStore.LookupStateReference<T>()
method. Instead, a newly added static class StoreExtension
provides an extension method of the same name.IStore.IterateStateReferences()
method.Swarm
became to have type parameter T
to represent an action type as like as BlockChain<T>
. [#324]
Swarm<T>
constructor became to receive BlockChain<T>
. [#324]
Swarm<T>
that had taken a parameter of BlockChain<T>
type became to neither longer take BlockChain<T>
nor a generic method. Because the Swarm<T>
constructor takes it instead. [#324]
Swarm<T>
does not implement ICollection<Peer>
anymore. [#326]
IStore.DeleteNamespace()
method. [#329]
id
parameter from the BlockChain<T>
constructor, and it became to automatically detect an appropriate BlockChain<T>.Id
. [#279, #332]
LiteDBStore
backend that uses LiteDB under the hood. [#269]
*Async()
methods belonging to TurnClient
class became to have cancellationToken
option. [#287]
Peer
constructor omitting appProtocolVersion
parameter to create a Peer
whose version is unknown. [#280]
IncompleteBlockStatesException
class. [#272, #285]
completeStates
option to BlockChain<T>.GetStates()
method. [#272, #285]
BlockChain<T>.MakeTransaction(PrivateKey, IEnumerable<T>, IImmutableSet<Address>, DateTimeOffset?)
method. [#294]
BlockChain<T>.GetNextTxNonce()
method which counts staged transactions too during nonce computation. [#270, #294]
StoreExtension
static class. [#272, #307]
BlockChain<T>.GetStates()
method became to throw IncompleteBlockStatesException
if its Store
lacks the states of a block that a requested address lastly updated. [#272, #285]
Swarm<T>
makes became to have multiple blocks within it, which means round trips on the network are now much reduced. [#273, #276]
Message.Block
has been replaced by Message.Blocks
and the magic number has been changed to 0x0a
. [#276]
Swarm<T>
's response time to GetBlockHashes
request messages. [#277]
Libplanet.Stun.StunAddress
. [#267, #271]
IStore.GetBlockStates()
became able to return null
to represent an absence of states (i.e., incomplete states). [#272, #285]
Swarm<T>
became to broadcast staged Transaction
s periodically so that game apps no more need to maintain their own thread to broadcast staged transactions. [#274, #297]
Swarm<T>
had sent an empty GetTxs
message when it receives an empty TxIds
from peers, and it had made the network waste bandwidth for unnecessary messages. Swam<T>
became to no more send such empty GetTxs
. [#297]
BlockChain<T>.Swap()
became to delete an index, tx nonces, and state references in the replaced chain. [#329]
BlockChain<T>.FindBranchPoint()
method under the circumstances that the height of the BlockChain<T>
object is high. [#282, #299]
Swarm<T>
reported TaskCanceledException
as an unknown exception while stopping. [#275]
Swarm<T>
didn't stop properly during Swarm<T>.PreloadAsync()
. [#275]
TxNonce
of an address is not invalidated when forking using FileStore.ForkTxNonce()
method. [#281]
LiteDBStore.GetTxNonce()
method throws a System.IO.IOException
after forking. [#281]
TurnClient
had not stopped properly. [#287]
TurnClient
had been trying to use an already closed connection. [#303, #308]
KeyNotFoundException
had been thrown instead of ArgumentOutOfRangeException
when Blockchain<T>[int]
called while the index of a block that does not exist locally. [#208, #317]
Swarm<T>
had not dial to other peer after Swarm<T>.PreloadAsync()
. [#311]
Swarm<T>
receiving a message. [#321, #327]
Published by dahlia over 5 years ago
Released on May 31, 2019.
IAction.Render(IActionContext, IAccountStateDelta)
method. [#31, #212]IAction.Unrender(IActionContext, IAccountStateDelta)
method. [#31, #212]BlockChain<T>.Validate()
method became to receiveIReadOnlyList<Block<<T>>
instead of IEnumerable<Block<T>>
. [#205]IBlockPolicy<T>.GetNextBlockDifficulty()
method became to receive IReadOnlyList<Block<<T>>
instead of IEnumerable<Block<T>>
. [#205]IBlockPolicy<T>.ValidateNextBlock(IReadOnlyList<Block<T>>, Block<T>)
method. [#210]IBlockPolicy<T>.ValidateBlocks()
method. [#210]BlockChain<T>[int]
became to throw ArgumentOutOfRangeException
instead of IndexOutOfRangeException
. [#210]KeyEquals()
methods from all classes and structs. [#216]Swarm
class now does not implement IEquatable<Swarm>
anymore and its Equals(object)
method and GetHashCode()
method became to have default behavior of object
class. [#216]Swarm
class now does not implement IDisposable
too. Thus Swarm.Dispose()
was removed too. [#218]Swarm
became to use a queue to maintain internal messages. [#218]
async
, so they are renamed as below.
Swarm.BroadcastBlocksAsync()
→ Swarm.BroadcastBlocks()
Swarm.BroadcastTxsAsync()
→ Swarm.BroadcastTxs()
Block<T>.Difficulty
is changed to long
instead of int
, and related classes method parameters and field types have changed accordingly.HashDigest.HasLeadingZeroBits()
method. [#213]IStore.PutBlock<T>(Block<T>)
method was changed to PutBlock<T>(Block<T>, Address)
. [[#189], #197]Block<T>.Hash
is no longer calculated using the full data of the Transaction<T>
, but is calculated using only the Transaction<T>.Id
. [#234]IStore.LookupStateReference<T>(string, Address, Block<T>)
method. [#232]IStore.StoreStateReference<T>(string, Block<T>)
method. [#232]IStore.ForkStateReferences<T>(string, string, Block<T>, IImmutableSet<Address>
method. [#232]Block<T>.Validate()
and Block<T>.EvaluateActions()
method. [#243]Transaction<T>.Nonce
and RawTransaction.Nonce
properties. [#246]IStore.GetTxNonce(string, Address)
method. [#246]IStore.IncreaseTxNonce<T>(string, Block<T>)
method. [#246]IStore.ForkTxNonce<T>(string, string, Block<T>, IImmutableSet<Address>
method. [#246]BlockChain<T>
became to implement IReadOnlyList<Block<T>>
. [#205]Swarm.DifferentVersionPeerEncountered
event handler that can handle events when a different version of a peer is discovered. [[#167]], [#185]Peer.AppProtocolVersion
property. [#185]Swarm.PreloadAsync()
method to explicitly and preemptively download initial blocks before Swarm.StartAsync<T>()
being called. [#204], [#206]BlockDownloadState
class to represent a block downloading state. [#204], [#206]BlockPolicyExtension.ValidateBlocks<T>(IBlockPolicy<T>, IReadOnlyList<Block<T>>, DateTimeOffset)
method. [#210]Transaction<T>.EvaluateActionsGradually(HashDigest<SHA256>, long, IAccountStateDelta, Address, bool)
method. [#31, #212]Block<T>.EvaluateActionsPerTx(AccountStateGetter)
method. [#31, #212]HashDigest.Satisfies()
method. [#213]BlockPolicy<T>
constructor became to receive the minimumDifficulty
and the mining difficultyBoundDivisor
. [#213]BlockChain<T>.UnstageTransactions()
method. [#223]Swarm
constructor became to receive a linger
(or millisecondsLinger
) parameter. This purposes to determine how long to wait for pending messages when a Swarm
instance is requested to terminate.NamespaceNotFoundException
class. [#232]Block<T>.Evaluate()
method. [#243]InvalidBlockTimestampException
class public
so that it can be caught. [#133, #251]InvalidTxNonceException
class. [#246]Swarm.StartAsync()
now receives the height of blocks (tip Index
) from other known peers and synchronizes the blocks if necessary before propagating/receiving pinpointed recent blocks to prevent inefficient round-trips. [#187, #190]BlockPolicy<T>.GetNextBlockDifficulty()
method was changed to the Ethereum Homestead algorithm except for the difficulty bomb. [#213]BlockSet<T>[int]
changed so as not to validate a block. [#231]Block<T>.Hash
and Transaction<T>.Id
. [#228, #234]Swarm.StartAsync()
now does not call Swarm.StopAsync()
anymore, therefore Swarm.StopAsync()
should be explicitly called. [#236]Transaction<T>.EvaluateActionsGradually()
became to record IAccountStateDelta.SetState()
calls even if its argument is the same to the previous state. [#241]Block<T>.Validate()
and Block<T>.EvaluateActions()
are integrated into Block<T>.Evaluate()
. [#243]BlockChain<T>.Append()
became to execute Action.Execute()
only once per action in the Block<T>
. [#243]BlockChain<T>.Append()
method became to throw InvalidTxNonceException
when the Transaction<T>.Nonce
does not correspond to its Signer
's current nonce. [#246]Swarm
became to enforce ForceDotNet.Force()
in AsyncIO while it's running on Mono runtime. [#247]Swarm
had attempted to use TURN relay even if the host
argument was given. [#198]BlockChain<T>.Append()
.BlockChain<T>
while blocks are being mined by BlockChain<T>.MineBlock()
. [#191]TurnClientException
had been thrown by Swarm when a STUN nonce is stale. [#193]BlockChain<T>.GetStates()
had descended to the bottom (i.e., the genesis block) where a given Address
refers to a nonexistent account (i.e., never used before). [[#189], #192]BlockChain<T>.Append()
method became to validate only the next block to be appended. [#210]BlockChain<T>.Fork()
performance by avoiding double validation of already validated blocks. [#215]BlockChain<T>.StageTransactions()
. [#217]BlockChain<T>.Append()
method by removing unnecessary race conditions. [#217]Swarm
could not properly communicate with Peer
behind NAT. [#240]BlockChain<T>.FindNextHashes()
throws ArgumentOutOfRangeException
when chain is empty.TurnClient.AcceptRelayedStreamAsync()
didn't handle concurrent connections correctly. [#256]Published by libplanet over 5 years ago
Published by libplanet over 5 years ago
Released on April 7, 2019.
This version purposes to entirely replace 0.2.0, because a wrong .nupkg file was uploaded to 0.2.0 on NuGet Gallery. Note that 0.2.0 on NuGet Gallery was unlisted.
Published by libplanet over 5 years ago
Released on April 5, 2019.
PrivateKey.Decrypt()
now throws an InvalidCiphertextException
instead of returning null
when cipherText
is invalid. [#140]
Transaction<T>
's Sender
–Recipient
model was replaced by Signer
–UpdatedAddresses
model. Unlike cryptocurrencies, transactions in games are not necessarily a transfer of assets, so it is difficult to determine what type of asset is transferred or who will receives the asset. A more useful perspective is, like what kind of transformation is performed, or what states are changed. To be close to this perspective, we decided to get rid of Transaction<T>.Recipient
(which is singular) and have Transaction<T>.UpdatedAddresses
(which is plural) instead. As there is no more asset to transfer, the term Sender
was also renamed to Signer
, which fits more to the new perspective. [#121]
Transaction<T>.Sender
, RawTransaction.Signer
, and IActionContext.From
properties to Signer
. The corresponding parameter names on constructors and methods were also renamed too.Transaction<T>.Make()
factory method is replaced by new Transaction<T>.Create()
factory method. The timestamp
parameter became optional, and the new optional updatedAddresses
parameter was added.IActionContext.To
property.Transaction<T>.Recipient
and RawTransaction.Recipient
properties were replaced by Transaction<T>.UpdatedAddresses
and RawTransaction.UpdatedAddresses
properties. The corresponding parameter names on constructors and methods were replaced too.RawTransaction
class was changed, the serialization format of transactions and blocks were also changed. It affects to the way to generate Transaction<T>.Signature
, Transaction<T>.Id
, and Block.Hash
values as well.InvalidTxUpdatedAddressesException
exception class.Block<T>.Validate()
method was gone so that the block validation API is always time-wise. Instead, Block<T>.Validate()
method now has only one overload: Validate(DateTimeOffset, AccountStateGetter)
returning IAccountStateDelta
.Block<T>.Validate()
and BlockChain<T>.Validate()
methods now can throw an InvalidTxUpdateAddressesException
.The Address
es IAction
tries to update no more need to be manually coded using IAction.RequestStates()
method. That method was removed at all, and updated Address
es became automatically determined (for the most cases) by track "dirties" on rehearsal mode. This mode dry-runs IAction
s with empty IActionContext.PreviousStates
. [#121]
AccountStateGetter
delegate to provide a read-only view to account states.IAccountStateDelta
interface to replace AddressStateMap
. The interface purposes to provide a read-write view to account states with maintaining UpdatedAddresses
(so-called "dirty"). [#98]
IActionContext.PreviousStates
property was changed from AddressStateMap
to IAccountStateDelta
.IActionContext.Rehearsal
property. [#131, #135]
UnexpectedlyTerminatedTxRehearsalException
class. [#132, #136]
IAction.Execute()
method was changed from AddressStateMap
to IAccountStateDelta
.IAction.RequestStates()
method because there is no need for it and thus it is not used anymore.Transaction<T>.EvaluateActions()
method.Block<T>.EvaluateActions()
generator method.The built-in subtype polymorphism of IAction
and Transaction<T>
was moved to a separated new PolymorphicAction<T>
abstract class. Polymorphic actions now should be wrapped by PolymorphicAction<T>
. For example, the following code:
public abstract class AbstractAction : IAction { ... }
[ActionType("attack")]
public sealed class Attack : AbstractAction { ... }
[ActionType("sleep")]
public sealed class Sleep : AbstractAction { ... }
var tx = Transaction<AbstractAction>.Create(
...,
actions: new[] { new Attack(...), ... }
);
should be changed to like:
var tx = Transaction<PolymorphicAction<AbstractAction>>.Create(
...,
actions: new[] {
new PolymorphicAction<AbstractAction>(new Attack(...)),
...
}
);
It can be simpler by implicit casting:
var tx = Transaction<PolymorphicAction<AbstractAction>>.Create(
...,
actions: new PolymorphicAction<AbstractAction>[] { new Attack(...), }
);
[#169]
T
of Transaction<T>
, Block<T>
, and BlockChain<T>
became to require having a public
parameterless constructor (i.e., new()
) besides implementing IAction
interface. This means an abstract class
or an interface
no more can be passed to T
, but only a concrete class
or a struct
can be passed.Fixed a bug that mutating a collection of IAction
s passed to constructors or factory methods of Transaction<T>
had affected made instances as well. The type of Transaction<T>.Actions
property was changed from IList<T>
to IImmutableList<T>
. The corresponding parameters on constructors and factory methods also were changed to take IEnumerable<T>
instead of IList<T>
.
InvalidTxException
and its subclasses became to have TxId
property and the corresponding constructor parameter. This can be useful when multiple Transaction<T>
objects are validated at once.
Added Address.Size
constant, which is fixed to the Int32
20.
Fixed a bug that Block<T>.Validate()
had not thrown InvalidTxException
even if there is any integrity error on its Transactions
.
Improved the write throughput of BlockChain<T>
while polling BlockChain<T>.GetStates()
Swarm.AddPeersAsync()
was fixed so that unreachable Peer
s are ignored. [#128]
Swarm
became able to relay their connection via TURN (RFC 5766) to NAT traversal. To enable this, its constructor (Swarm()
) takes the newly added IceServer
s as configuration.
Since we decided to depend on TURN (RFC 5766) and STUN (RFC 5389) to work around NAT so that Peer
's endpoints don't have to be multiple, Peer.Urls
was renamed to Peer.EndPoint
and its type also was changed from IImmutableList<Uri>
to DnsEndPoint
. [#120, #123 by Yang Chun Ung, #126, #127, #165, #166]
Swarm
became to ignore tip blocks of the same height (Index
) that it already has and deal with only longer (higher) blocks.
Fixed a bug that occured when Swarm
was handling multiple responses at the same time.
Fixed a bug that the Swarm
constructor had hanged in certain runtimes like Unity engine.
Removed AddressTransactionSet
which handles handle Address
to IEnumerable<TxId>
indices, and the following methods in IStore
:
IStore.IterateAddresses()
IStore.GetAddressTransactionIds()
IStore.AppendAddressTransactionId()
IStore.CountAddresses()
Added IStore.ListNamespaces()
method.
IStore.CountBlocks()
and IStore.CountTransactions()
became to return long
.
Block/tx-related methods in IStore
and BaseIndex<T>
no longer accepts @namespace
parameter. It means that even if a forking occurs, the same block/tx files are shared.
Fixed a bug that made unnecessary fork when receiving blocks from other peer.
Action classes that implement IAction
but lack ActionTypeAttribute
became reported by PolymorphicAction<T>
throwing MissingActionTypeException
at runtime. [#28, #144, #169]
Turn into parameter in BlockPolicy
's constructor to milliseconds. [#151]
BencodexFormatter
became able to serialize BigInteger
. [#159]
Made Swarm
possible to configure its network appProtocolVersion
and, to ignore peers if their version is different. [#167], [#170]
Renamed Block<T>.RewardBeneficiary
to Block<T>.Miner
. [#174]
Added BlockChain<T>.Blocks
property. [#176]
Added BlockChain<T>.Transactions
property. [#176]
Published by libplanet over 5 years ago
Released on March 5, 2019.
Swarm
and SwarmTest
.Published by libplanet over 5 years ago
Initial release. Released on February 26, 2019.