Libplanet changelog
Version 1.4.0
Released on June 7, 2023.
Backward-incompatible API changes
- Removed
IBlockChainStates.GetTrie()
interface method. [#3168] - Removed
PolymorphicAction<T>
class. [#3193] - Changed
BlockChain.Create()
to acceptIActionEvaluator
interface instead ofActionEvaluator
object. [#3195] - Removed
blockAction
parameter fromBlockChain.EvaluateGenesis()
,BlockChain.DetermineGenesisStateRootHash()
, andBlockChain.ProposeGenesisBlock()
methods. [#3195]
Version 1.3.0
Released on May 19, 2023.
Backward-incompatible API changes
- Renamed
PreloadState
asBlockSyncState
. [#3154] - Replaced
Swarm<T>.PreloadAsync
's parameterIProgress<PreloadState> progress
asIProgress<BlockSyncState> progress
. [#3154] - Moved
IAccountStateDelta
and relations interface toLibplanet.State
namespace (fromLibplanet.Action
namespace). [#3173] - Changed
BlockChain<T>()
constructors to explicitly require anIBlockChainStates
and anIActionEvaluator
. [#3172] - Changed
BlockChain<T>.DetermineGenesisStateRootHash()
,BlockChain<T>.EvaluateGenesis()
, andBlockChain<T>.ProposeGenesisBlock()
to explicitly requireIActionEvaluator
. [#3172] - Removed type parameter
T
fromBlockChain<T>
class. [#3182] - Removed type parameter
T
fromIBlockPolicy<T>
interface. [#3182] - Removed type parameter
T
fromIStagePolicy<T>
interface. [#3182] - Removed type parameter
T
fromContext<T>
class. [#3183] - Removed type parameter
T
fromConsensusContext<T>
class. [#3183] - Removed type parameter
T
fromConsensusReactor<T>
class. [#3183] - Removed type parameter
T
fromBlockCandidateTable<T>
class. [#3184] - Removed type parameter
T
fromTxCompletion<T>
class. [#3184] - Removed type parameter
T
fromSwarm<T>
class. [#3184] - (Libplanet.Explorer) Removed type parameter
T
requiringT
asIAction
from all classes. [#3185]
Behavioral changes
Gossip
became to store theMessageId
s received through theHaveMessage
instead of immediately replying to them, and send theWantMessage
requests all at once during eachHeartbeatTask
. #3152Swarm<T>.PreloadAsync()
usePullBlocksAsync()
andConsumeBlockCandidates()
. [#3154]Swarm<T>.PreloadAsync()
usesBlockCandidateTable<T>
to cache downloadedBlock
s, instead of storing them on forkedBlockChain<T>
. [#3154]Swarm<T>.PullBlocksAsync()
andSwarm<T>.GetDemandBlockHashes()
iterates using new parameterchunkSize
. [#3154]Swarm<T>.ConsumeBlockCandidates()
repeats iff new parametercheckInterval
is not null. [#3154]Swarm<T>.ConsumeBlockCandidates()
does not renders if new parameterrender
isfalse
. [#3154]Swarm<T>.PullBlocksAsync()
andSwarm<T>.GetDemandBlockHashes()
receives new parameterIProgress<BlockSyncState> progress
and will report progress to it, if it's given. [#3154]- Moved creation of
BlockDemandTable
andBlockCandidateTable
to constructor ofSwarm<T>
fromSwarm<T>.StartAsync()
. [#3154]
Version 1.2.1
Released on May 17, 2023.
- (Libplanet.Explorer) Fixed a bug where a
TransactionQuery
could not properly retrieve actions. [#3174]
Version 1.2.0
Released on May 16, 2023.
Deprecated APIs
- Removed
StaticActionLoader
class. UseSingleActionLoader
instead. [#3148] - Removed
Mint
andTransfer
class. [#3159]
Backward-incompatible API changes
- Removed type parameter
T
fromTransaction.Create<T>()
andPreEvaluationBlock.Evaluate<T>()
. [#3122] - Signatures of
IActionRenderer<T>
's methods was changed. [#3117]- The signature of
RenderAction(IAction, IActionContext, IAccountStateDelta)
method was changed toRenderAction(IValue, IActionContext, IAccountStateDelta)
. - The signature of
RenderActionError(IAction, IActionContext, Exception)
method was changed toRenderActionError(IValue, IActionContext, Exception)
.
- The signature of
- Added
SingleActionLoader
,TypedActionLoader
, andIndexedActionLoader
classes. [#3148] - Removed
trieGetter
parameter fromActionEvaluator
constructor. [#3149] - Added
IBlockChainStates.GetTrie()
interface method. [#3149] BlockChain<T>.Create()
static method now requiresactionEvaluator
parameter explicitly. [#3149]- Removed
IBlockPolicy.NativeTokens
property. [#3153]- Removed
NonNativeTokenException
class. - Removed
IActionContext.IsNativeToken()
method. - Removed
nativeTokenPredicate
parameter fromActionEvaluator()
- Removed
nativeTokenPredicate
parameter from allBlockChain<T>
's methods. - (Libplanet.Explorer) Removed
BlockPolicyType<T>
class.
- Removed
- Removed generic type parameter
T
fromIRenderer<T>
and all its implementations. [#3163] - Removed
IActionContext.GenesisHash
property. [#3164] - Removed
genesisHash
parameter fromActionEvaluator()
. [#3164]
Added APIs
- Added
IActionContext.GasUsed()
method. [#3144] - Added
IActionContext.GasLimit()
method. [#3144] - Added
PolymorphicAction<T>.ReloadLoader()
static method. [#3158]
Behavioral changes
Transaction.Create()
method no more fillsTransaction.UpdatedAddresses
automatically. [[#368], #3122]Mint
andTransfer
IAction
s no longer check for native tokens. [#3153]
Version 1.1.1
Released on May 15, 2023.
- (@planetarium/cli) Fixed the installer bug that it had failed on Linux and macOS since version 1.0.2. [#3107, #3160, #3161]
Version 1.1.0
Released on May 9, 2023.
Backward-incompatible API changes
- Changed the encoding scheme and related methods for
TxActionList
. [#3083]- Removed
TxActionList.FromBencodex<T>()
method. - Changed the return type for
TxActionList.ToBencodex()
fromDictionary
toIValue
.
- Removed
- Removed
IRenderer<T>.RenderReorg()
,IRenderer<T>.RenderReorgEnd()
,IActionRenderer<T>.UnrenderAction()
, andIActionRenderer<T>.UnrenderActionError()
. [#3092] - Removed
NonblockRenderer
,NonblockActionRenderer
,DelayedRenderer
, andDelayedActionRenderer
classes. [#3098] - (Libplanet.Net) Removed optional
render
parameter from allSwarm<T>.PreloadAsync()
overload methods. No rendering is done during the preloading phase. [#3108] TxActionList
now implementsIBencodable
interface. [#3110]- Removed
FromBencodex()
static method; useTxActionList(IValue)
constructor instead. - Removed
ToBencodex()
method; useTxActionList.Bencoded
instead.
- Removed
TxActionList
now implementsIEnumerable<IValue>
instead ofIEnumerable<IAction>
. [#3110]- Changed
TxSystemAction.SystemAction
to return anIValue
. - Changed
TxCustomActions.CustomActions
to return anIImmutableList<IValue>
.
- Changed
TxActionList
's JSON representation has changed. It no longer has"type"
field. [#3110]- Changed the type for
ActionTypeAttribute.TypeIdentifier
fromstring
toIValue
. [#3111] - Changed the return type for
ActionTypeAttribute.ValueOf()
fromstring?
toIValue?
. [#3111] - Changed the return type for
IActionTypeLoader.Load()
fromIDictionary<string, Type>
toIDictionary<IValue, Type>
. [#3111] - Changed return types and parameter types of several methods from
IReadOnlyList<ActionEvaluation>
toIReadOnlyList<IActionEvaluation>
. [#3089]BlockChain<T>.DetermineGenesisStateRootHash()
method'sevaluations
parameter type.BlockChain<T>.DetermineBlockStateRootHash()
method'sevaluations
parameter type.BlockChain<T>.EvaluateBlock()
method's return type.BlockChain<T>.EvaluateGenesis()
method's return type.
- Removed
BlockChain<T>.MakeTransaction(PrivateKey, IAction, IImmutableSet<Address>, DateTimeOffset?)
. [#3116] - Removed
Transaction<T>.Create(long, PrivateKey, BlockHash?, IAction, IImmutableSet<Address>?, DateTimeOffset?)
. [#3116] - Added
Transaction<T>.Create(long, PrivateKey, BlockHash?, IEnumerable<IValue>, IImmutableSet<Address>?, DateTimeOffset?)
. [#3116] - Removed
ITransaction.SystemAction
andITransaction.CustomActions
. UseITxInvoice.Actions
instead. [#3116] - Overhauled
TxActionList
class. [#3116]- Changed
TxActionList
class to besealed
fromabstract
.TxActionList
is pretty much the oldTxCustomActionsList
. - Changed the JSON representation of
TxActionList
to be more simple. - Removed
TxSystemActionList
andTxCustomActionsList
- Changed
- Changed
Transaction<T>
toTransaction
to be non-generic. [#3121] - Changed
Block<T>
toBlock
to be non-generic. [#3123]- Removed
IBlockContent<T>
interface. UseIBlockContent
instead. Also changedIBlockContent.IImmutableSet<ITransaction>
toIBlockContent.ReadOnlyList<ITransaction>
. - Changed
BlockContent<T>
toBlockContent
. - Removed
IPreEvaluationBlock<T>
interface. UseIPreEvaluationBlock
instead. - Changed
PreEvaluationBlock<T>
toPreEvaluationBlock
.PreEvaluationBlock.Evaluate<T>()
now requires type parameterT
.
- Removed
- Removed
PreEvaluationBlock.Evaluate<T>()
method. [#3127] - Renamed
IActionTypeLoader
toIActionLoader
. [#3135]- Added
IActionLoader.Load(long, IValue)
interface method. - Removed
ActionTypeLoaderContext
class. Uselong
instead. - Renamed
StaticActionTypeLoader
toStaticActionLoader
.
- Added
- Added
IActionEvaluator.IActionLoader
property. [#3136] - Changed
IActionLoader.LoadAction()
to throwInvalidActionException
instead ofArgumentException
when an action cannot be instantiated. [#3140]
Added APIs
- Added
IActionEvaluator
interface. [#3082] - Added
SwarmOptions.TaskRegulationOptions
property. [[#3109]] - Added
TaskRegulationOptions
class. [[#3109]] - Added
ActionTypeAttribute(int)
constructor. [#3111] - Added
IActionEvaluation
interface. [#3089] - Added parameterless constructor to
Mint
,Transfer
, andInitialize
. [#3112] - Added
InvalidActionException
class. [#3140]
Behavioral changes
- Changed
BlockChain<T>
to ignoreIRenderer<T>.RenderReorg()
,IRenderer<T>.RenderReorgEnd()
,IActionRenderer<T>.UnrenderAction()
, andIActionRenderer<T>.UnrenderActionError()
, i.e., these interface methods are no longer invoked by aBlockChain<T>
. [#3087] - Changed
Context<T>.ConsumeMutation()
to iteratively callContext<T>.ProcessGenericUponRules()
itself, instead of producing submutations of it. [#3137] - (Libplanet.Explorer) The
CurrencyInputType
'stotalSupplyTrackable
field became nullable withfalse
as its default value. [#3151]
Bug fixes
- Fixes a bug where
BlockChain<T>
could not propose if a certain type of invalidTransaction
was staged. [#3136] - Fixes a bug where
Context<T>
would completely halt if aBlock
with anIValue
as one of its action that cannot be instantiated via itsIActionLoader
. [#3140]
Dependencies
- Upgrade Bencodex from [0.8.0][Bencodex 0.8.0] to 0.10.0. [#3106]
- Upgrade Bencodex.Json from [0.8.0][Bencodex.Json 0.8.0] to 0.10.0. [#3106]
Version 1.0.3
Released on May 15, 2023.
- (@planetarium/cli) Fixed the installer bug that it had failed on Linux and macOS since version 1.0.2. [#3107, #3160]
Version 1.0.2
Released on May 4, 2023.
- (Libplanet.Tools) The
planet
command now falls back to the default cryptography backend instead of crash when it fails to load libsecp256k1 at runtime. [#3138] - (@planetarium/cli) Fixed the installer bug that it had failed with some recent Node.js versions on Windows. [#3107, #3138]
Version 1.0.1
Released on May 3, 2023.
- Fixed a bug where
BlockChain<T>.Append()
hadn't update tx executions evenevaluateActions
set totrue
whenactionEvaluations
are given. [#3125] - (Libplanet.Explorer) Fixed a bug where
BlockQuery.blocks
field had thrownKeyNotFoundException
when appending block simultaneously. [#3126, #3130]
Version 1.0.0
Released on April 18, 2023.
Deprecated APIs
- (@planerarium/account) Deprecated
RawPrivateKey.publicKey
property in favour ofRawPrivateKey.getPublicKey()
async method. [#3061] - (@planetarium/account-aws-kms) Deprecated
AwsKmsAccount.publicKey
in favour ofAwsKmsAccount.getPublicKey()
async method. [#3061]
Backward-incompatible API changes
- Removed
TxMetadata
class. [[#1164], #2986]- Removed
Transaction<T>(TxMetadata, IAction, byte[])
constructor. - Removed
Transaction<T>(TxMetadata, IEnumerable<T>, byte[])
constructor.
- Removed
- Reorganized
ITransaction
interface in general. [[#1164], #2986]ITransaction
now inheritsIUnsignedTx
interface instead of having properties such asGenesisHash
,UpdatedAddresses
,Timestamp
,Nonce
,Signer
, andPublicKey
.SystemAction
property is replaced byActions
property which is inherited fromIUnsignedTx
interface.CustomActions
property is replaced byActions
property which is inherited fromIUnsignedTx
interface.
Transaction<T>
no more accept emptySignature
as a valid state. Instead, you should useUnsignedTx
class to represent an unsigned transaction. [[#1164], #2986]- Removed
Transaction<T>(long, Address, PublicKey, BlockHash?, IImmutableSet<Address>, DateTimeOffset, IEnumerable<T>, byte[])
constructor. - Removed
Transaction<T>.CreateUnsigned()
static method. - Removed
Transaction<T>.Validate()
method. - Removed
sign
parameter fromTransaction<T>.Serialize()
method. - Removed
validate
parameter fromTransaction<T>.Deserialize()
method.
- Removed
Transaction<T>
now hasActions
in a uniform way regardless they are custom actions or system actions, throughTxActionList
abstract class. [[#1164], #2986]- Changed the type of
Transaction<T>.Actions
property fromIImmutableList<IAction>
toTxActionList
, which is also anIReadOnlyList<IAction>
. The property once was deprecated in favour ofTransaction<T>.CustomActions
andTransaction<T>.SystemAction
, but now it replaces them both. - Removed
Transaction<T>.CustomActions
property. - Removed
Transaction<T>.SystemAction
property.
- Changed the type of
Transaction<T>(Bencodex.Types.Dictionary)
constructor is removed. UseTxMarshaler.UnmarshalTransaction<T>()
method instead. [#2986]- Removed
PreEvaluationBlock<T>.Evaluate(PrivateKey, IAction?, Predicate<Currency>, IStateStore)
,PreEvaluationBlock<T>.DetermineStateRootHash(IAction?, Predicate<Currency>, IStateStore)
,PreEvaluationBlock<T>.DetermineStateRootHash(IAction?, Predicate<Currency>, IStateStore, out IImmutableDictionary<string, IValue>)
,PreEvaluationBlock<T>.DetermineStateRootHash(BlockChain<T>)
, andPreEvaluationBlock<T>.DetermineStateRootHash(BlockChain<T>, out IImmutableDictionary<string, IValue>)
,BlockChain<T>.ExecuteActions(Block<T>)
. [#3037] - (Libplanet.Extensions.Cocona) Changed signature of
ApvCommand.Verify(string?, string[]?, bool)
method toApvCommand.Verify(string?, PublicKey[]?, bool)
. [#3044] - Removed
PreEvaluationBlock<T>.Mine()
andBlockMetadata.MineNonce()
methods. [#3067] - Removed
HashCash
class. [#3067] - (@planetarium/account) Replaced
Account.publicKey
property withAccount.getPublicKey()
async method. [#3061] - (@planetarium/account) Added
Account.getAddress()
async method. [#3084] - (@planetarium/account)
Address.deriveFrom()
method now returnsPromise<Address>
when anAccount
is given. However, it still returnsAddress
when aPublicKey
is given. [#3061] - (@planetarium/account-web3-secret-storage)
Web3KeyStore
no more implementsImportableKeyStore<KeyId, RawPrivateKey>
. Instead, it now implementsImportableKeyStore<KeyId, Web3Account, Web3KeyMetadata>
. [#3061, #3084] - (Libplanet.Explorer) Added
Index
field toIBlockChainContext
interface. [#2613] - Removed
BlockChain<T>.ProposeBlock(PrivateKey, DateTimeOffset, long, int, int, IComparer<Transaction<T>>, BlockCommit)
method. [#3072] - Changed
BlockChain<T>.ProposeBlock(PrivateKey, DateTimeOffset, BlockCommit, IComparer<Transaction<T>>)
method toBlockChain<T>.ProposeBlock(PrivateKey, BlockCommit, IComparer<Transaction<T>>)
. [#3077] - Changed
BlockChain<T>.ProposeGenesisBlock(IEnumerable<T>, IEnumerable<IAction>, PrivateKey, DateTimeOffset?, IAction, Predicate<Currency>)
toBlockChain<T>.ProposeGenesisBlock( PrivateKey, ImmutableList<Transaction<T>>, DateTimeOffset?, IAction, Predicate<Currency>)
. [#3079] - (Libplanet.Explorer)
Currency.decimalPlaces
' type becameByte
fromUInt
. [#3085] - (Libplanet.Explorer)
currencyHash
parameter was removed frombalance
andtotalSupply
inStateQuery
type. [#3085]
Added APIs
- Added
ITxInvoice
interface. [[#1164], #2986] - Added
ITxSigningMetadata
interface. [[#1164], #2986] - Added
IUnsignedTx
interface. [[#1164], #2986] - Added
TxInvoice
class. [[#1164], #2986] - Added
TxSigningMetadata
class. [[#1164], #2986] - Added
UnsignedTx
class. [[#1164], #2986] - Added
Transaction<T>(IUnsignedTx, ImmutableArray<byte>)
. [[#1164], #2986] - Added
BlockChain<T>.DetermineGenesisStateRootHash()
,BlockChain<T>.EvaluateGenesis()
,BlockChain<T>.DetermineBlockStateRootHash()
, andBlockChain<T>.EvaluateBlock()
. [#3037] - Added
PublicKey.FromHex()
static method. [#2709, #3044] - Added
PublicKey.ToHex()
method. [#2709, #3044] - (Libplanet.Net) Added
Gossip.PublishMessage()
method. [#3054, #3060] - (@planetarium/account) Added
Account.getPublicKey()
async method. [#3061] - (@planetarium/account) Added
Account.getAddress()
async method. [#3084] - (@planetarium/account) Added
RawPrivateKey.getPublicKey()
async method. [#3061] - (@planetarium/account) Added
RawPrivateKey.getAddress()
async method. [#3084] - (@planetarium/account-aws-kms) Added
AwsKmsAccount.getPublicKey()
async method. [#3061] - (@planetarium/account-aws-kms) Added
AwsKmsAccount.getAddress()
async method. [#3084] - (@planetarium/account-web3-secret-storage) Added
Web3Account
class. [#3061, #3084] - (@planetarium/account-web3-secret-storage) Added
Web3KeyObject
interface. [#3061] - (Libplanet.Explorer) Added several interfaces and classes that pertain to
blockchain indexing. [#2613]
- Added
IBlockChainIndex
interface. - Added
IIndexingContext
interface. - Added
BlockChainIndexBase
abstract class. - Added
RocksDbBlockChainIndex
class. - Added
RocksDbIndexingContext
class. - Added
IndexingService
class. - Added
IndexMismatchException
class.
- Added
- (Libplanet.Explorer.Cocona) New project was added to provide Cocona
commands related to Libplanet.Explorer project. [#2613]
- Added
IndexCommand
Cocona command class.
- Added
- (Libplanet.Explorer) Added
states
query inStateQuery
. [#3080] - (@planetarium/account) Added
Address.equals()
method. [#3071] - (@planetarium/account) Added
Address.isAddressOf()
method. [#3071] - (@planetarium/account) Added
PublicKey.equals()
method. [#3071] - (@planetarium/account-web3-secret-storage) Added
DecryptionOptions
interface. [#3071]- Added
Web3KeyStoreOptions.decryptionOptions
attribute.
- Added
- (@planetarium/account-web3-secret-storage) Added
WeakPrivateKeyError
class. [#3071] - (@planetarium/account-web3-secret-storage) Added
Web3KeyMetadata
interface. [#3084] - (Libplanet.Tools) Added
-v
/--validator-key
option toplanet block generate-genesis
command. [#3088] - (Libplanet.Explorer) Added
CurrencyInput
type. [#3085] - (Libplanet.Explorer) Added
CurrencyInput
-typedcurrency
parameter tobalance
andtotalSupply
inStateQuery
type. [#3085]
Behavioral changes
Added
TypeConverter
to commonly-used types. [#2711, #3044]Address
now can be converted from and tostring
throughTypeConverter
.HashDigest<T>
now can be converted from and tostring
throughTypeConverter
.PublicKey
now can be converted from and tostring
throughTypeConverter
.
Transaction<T>
no more supports deserialization from JSON when it contains custom actions. However, it still can be deserialized from JSON when it contains a system action. [#2986]Transaction<T>.UpdatedAddresses
now preserves the order ofAddress
es so that it is no more reordered during deserialization. [#3074]The JSON representation of
Transaction<T>
now includes the"actions"
field, which includes a system action or a list of custom actions and a"type"
field denoting one of"system"
or"custom"
.For example:
{ // ... other fields "actions": { "type": "system", "systemAction": { // system action details } } }
Instead of:
{ // ... other fields "systemAction": { // system action details } }
(@planetarium/account-web3-secret-storage)
Web3KeyStore.get()
method now defersPassphraseEntry.authenticate()
call and account unlocking so thatAccountRetrieval
instance can be gathered without unlocking the account. Instead,PassphraseEntry.authenticate()
is called when operations that require unlockingWeb3Account
are called, such assign()
orgetPublicKey()
. [#3061](Libplanet.Explorer) Now, when an
IBlockChainIndex
instance is available in the optionalIndex
property of the injectedIBlockChainContext
instance, GraphQL queries can benefit from the improved lookup performance of the index. Applications willing to take advantage of the index should provide an instance ofIBlockChainIndex
to theIBlockChainContext
implementation and add theIndexingService
hosted service to sync the index in the background. Note that the synchronization may take a long time if you have a lot of blocks (over 24 hours for ~5M blocks). [#2613]BlockRef
property ofTransactionType
now usesIBlockChainIndex
if available.transactionResult
query inTransactionQuery
now usesIBlockChainIndex
if available.
(@planetarium/account-web3-secret-storage)
Web3KeyStore
now supports Scrypt as one of KDF functions besides PBKDF2. [#3071]
Bug fixes
- In
PreVote
block validation,Context<T>.IsValid()
, validate the block header and also the block content (e.g., Tx nonces, Policy defined validation rules, or state root hash.) [#2973, #2996] - (@planetarium/account-web3-secret-storage) Fixed a bug where
Web3KeyStore.import()
andWeb3KeyStore.generate()
methods had written JSON field"Crypto"
instead of"crypto"
in the key file. [#3071]
Dependencies
- *@planetarium/account-aws-kms* now has *@planetarium/account* as a peer dependency instead of a normal dependency. [#3069]
- *@planetarium/account-web3-secret-storage* now has *@planetarium/account* as a peer dependency instead of a normal dependency. [#3069]
- *@planetarium/tx* now has *@planetarium/account* as a peer dependency instead of a normal dependency. [#3069]