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 acceptIActionEvaluatorinterface instead ofActionEvaluatorobject. [#3195] - Removed
blockActionparameter fromBlockChain.EvaluateGenesis(),BlockChain.DetermineGenesisStateRootHash(), andBlockChain.ProposeGenesisBlock()methods. [#3195]
Version 1.3.0
Released on May 19, 2023.
Backward-incompatible API changes
- Renamed
PreloadStateasBlockSyncState. [#3154] - Replaced
Swarm<T>.PreloadAsync's parameterIProgress<PreloadState> progressasIProgress<BlockSyncState> progress. [#3154] - Moved
IAccountStateDeltaand relations interface toLibplanet.Statenamespace (fromLibplanet.Actionnamespace). [#3173] - Changed
BlockChain<T>()constructors to explicitly require anIBlockChainStatesand anIActionEvaluator. [#3172] - Changed
BlockChain<T>.DetermineGenesisStateRootHash(),BlockChain<T>.EvaluateGenesis(), andBlockChain<T>.ProposeGenesisBlock()to explicitly requireIActionEvaluator. [#3172] - Removed type parameter
TfromBlockChain<T>class. [#3182] - Removed type parameter
TfromIBlockPolicy<T>interface. [#3182] - Removed type parameter
TfromIStagePolicy<T>interface. [#3182] - Removed type parameter
TfromContext<T>class. [#3183] - Removed type parameter
TfromConsensusContext<T>class. [#3183] - Removed type parameter
TfromConsensusReactor<T>class. [#3183] - Removed type parameter
TfromBlockCandidateTable<T>class. [#3184] - Removed type parameter
TfromTxCompletion<T>class. [#3184] - Removed type parameter
TfromSwarm<T>class. [#3184] - (Libplanet.Explorer) Removed type parameter
TrequiringTasIActionfrom all classes. [#3185]
Behavioral changes
Gossipbecame to store theMessageIds received through theHaveMessageinstead of immediately replying to them, and send theWantMessagerequests all at once during eachHeartbeatTask. #3152Swarm<T>.PreloadAsync()usePullBlocksAsync()andConsumeBlockCandidates(). [#3154]Swarm<T>.PreloadAsync()usesBlockCandidateTable<T>to cache downloadedBlocks, 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 parametercheckIntervalis not null. [#3154]Swarm<T>.ConsumeBlockCandidates()does not renders if new parameterrenderisfalse. [#3154]Swarm<T>.PullBlocksAsync()andSwarm<T>.GetDemandBlockHashes()receives new parameterIProgress<BlockSyncState> progressand will report progress to it, if it's given. [#3154]- Moved creation of
BlockDemandTableandBlockCandidateTableto constructor ofSwarm<T>fromSwarm<T>.StartAsync(). [#3154]
Version 1.2.1
Released on May 17, 2023.
- (Libplanet.Explorer) Fixed a bug where a
TransactionQuerycould not properly retrieve actions. [#3174]
Version 1.2.0
Released on May 16, 2023.
Deprecated APIs
- Removed
StaticActionLoaderclass. UseSingleActionLoaderinstead. [#3148] - Removed
MintandTransferclass. [#3159]
Backward-incompatible API changes
- Removed type parameter
TfromTransaction.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, andIndexedActionLoaderclasses. [#3148] - Removed
trieGetterparameter fromActionEvaluatorconstructor. [#3149] - Added
IBlockChainStates.GetTrie()interface method. [#3149] BlockChain<T>.Create()static method now requiresactionEvaluatorparameter explicitly. [#3149]- Removed
IBlockPolicy.NativeTokensproperty. [#3153]- Removed
NonNativeTokenExceptionclass. - Removed
IActionContext.IsNativeToken()method. - Removed
nativeTokenPredicateparameter fromActionEvaluator() - Removed
nativeTokenPredicateparameter from allBlockChain<T>'s methods. - (Libplanet.Explorer) Removed
BlockPolicyType<T>class.
- Removed
- Removed generic type parameter
TfromIRenderer<T>and all its implementations. [#3163] - Removed
IActionContext.GenesisHashproperty. [#3164] - Removed
genesisHashparameter 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.UpdatedAddressesautomatically. [[#368], #3122]MintandTransferIActions 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()fromDictionarytoIValue.
- Removed
- Removed
IRenderer<T>.RenderReorg(),IRenderer<T>.RenderReorgEnd(),IActionRenderer<T>.UnrenderAction(), andIActionRenderer<T>.UnrenderActionError(). [#3092] - Removed
NonblockRenderer,NonblockActionRenderer,DelayedRenderer, andDelayedActionRendererclasses. [#3098] - (Libplanet.Net) Removed optional
renderparameter from allSwarm<T>.PreloadAsync()overload methods. No rendering is done during the preloading phase. [#3108] TxActionListnow implementsIBencodableinterface. [#3110]- Removed
FromBencodex()static method; useTxActionList(IValue)constructor instead. - Removed
ToBencodex()method; useTxActionList.Bencodedinstead.
- Removed
TxActionListnow implementsIEnumerable<IValue>instead ofIEnumerable<IAction>. [#3110]- Changed
TxSystemAction.SystemActionto return anIValue. - Changed
TxCustomActions.CustomActionsto return anIImmutableList<IValue>.
- Changed
TxActionList's JSON representation has changed. It no longer has"type"field. [#3110]- Changed the type for
ActionTypeAttribute.TypeIdentifierfromstringtoIValue. [#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'sevaluationsparameter type.BlockChain<T>.DetermineBlockStateRootHash()method'sevaluationsparameter 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.SystemActionandITransaction.CustomActions. UseITxInvoice.Actionsinstead. [#3116] - Overhauled
TxActionListclass. [#3116]- Changed
TxActionListclass to besealedfromabstract.TxActionListis pretty much the oldTxCustomActionsList. - Changed the JSON representation of
TxActionListto be more simple. - Removed
TxSystemActionListandTxCustomActionsList
- Changed
- Changed
Transaction<T>toTransactionto be non-generic. [#3121] - Changed
Block<T>toBlockto be non-generic. [#3123]- Removed
IBlockContent<T>interface. UseIBlockContentinstead. Also changedIBlockContent.IImmutableSet<ITransaction>toIBlockContent.ReadOnlyList<ITransaction>. - Changed
BlockContent<T>toBlockContent. - Removed
IPreEvaluationBlock<T>interface. UseIPreEvaluationBlockinstead. - Changed
PreEvaluationBlock<T>toPreEvaluationBlock.PreEvaluationBlock.Evaluate<T>()now requires type parameterT.
- Removed
- Removed
PreEvaluationBlock.Evaluate<T>()method. [#3127] - Renamed
IActionTypeLoadertoIActionLoader. [#3135]- Added
IActionLoader.Load(long, IValue)interface method. - Removed
ActionTypeLoaderContextclass. Uselonginstead. - Renamed
StaticActionTypeLoadertoStaticActionLoader.
- Added
- Added
IActionEvaluator.IActionLoaderproperty. [#3136] - Changed
IActionLoader.LoadAction()to throwInvalidActionExceptioninstead ofArgumentExceptionwhen an action cannot be instantiated. [#3140]
Added APIs
- Added
IActionEvaluatorinterface. [#3082] - Added
SwarmOptions.TaskRegulationOptionsproperty. [[#3109]] - Added
TaskRegulationOptionsclass. [[#3109]] - Added
ActionTypeAttribute(int)constructor. [#3111] - Added
IActionEvaluationinterface. [#3089] - Added parameterless constructor to
Mint,Transfer, andInitialize. [#3112] - Added
InvalidActionExceptionclass. [#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'stotalSupplyTrackablefield became nullable withfalseas its default value. [#3151]
Bug fixes
- Fixes a bug where
BlockChain<T>could not propose if a certain type of invalidTransactionwas staged. [#3136] - Fixes a bug where
Context<T>would completely halt if aBlockwith anIValueas 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
planetcommand 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 evenevaluateActionsset totruewhenactionEvaluationsare given. [#3125] - (Libplanet.Explorer) Fixed a bug where
BlockQuery.blocksfield had thrownKeyNotFoundExceptionwhen appending block simultaneously. [#3126, #3130]
Version 1.0.0
Released on April 18, 2023.
Deprecated APIs
- (@planerarium/account) Deprecated
RawPrivateKey.publicKeyproperty in favour ofRawPrivateKey.getPublicKey()async method. [#3061] - (@planetarium/account-aws-kms) Deprecated
AwsKmsAccount.publicKeyin favour ofAwsKmsAccount.getPublicKey()async method. [#3061]
Backward-incompatible API changes
- Removed
TxMetadataclass. [[#1164], #2986]- Removed
Transaction<T>(TxMetadata, IAction, byte[])constructor. - Removed
Transaction<T>(TxMetadata, IEnumerable<T>, byte[])constructor.
- Removed
- Reorganized
ITransactioninterface in general. [[#1164], #2986]ITransactionnow inheritsIUnsignedTxinterface instead of having properties such asGenesisHash,UpdatedAddresses,Timestamp,Nonce,Signer, andPublicKey.SystemActionproperty is replaced byActionsproperty which is inherited fromIUnsignedTxinterface.CustomActionsproperty is replaced byActionsproperty which is inherited fromIUnsignedTxinterface.
Transaction<T>no more accept emptySignatureas a valid state. Instead, you should useUnsignedTxclass 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
signparameter fromTransaction<T>.Serialize()method. - Removed
validateparameter fromTransaction<T>.Deserialize()method.
- Removed
Transaction<T>now hasActionsin a uniform way regardless they are custom actions or system actions, throughTxActionListabstract class. [[#1164], #2986]- Changed the type of
Transaction<T>.Actionsproperty fromIImmutableList<IAction>toTxActionList, which is also anIReadOnlyList<IAction>. The property once was deprecated in favour ofTransaction<T>.CustomActionsandTransaction<T>.SystemAction, but now it replaces them both. - Removed
Transaction<T>.CustomActionsproperty. - Removed
Transaction<T>.SystemActionproperty.
- 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
HashCashclass. [#3067] - (@planetarium/account) Replaced
Account.publicKeyproperty withAccount.getPublicKey()async method. [#3061] - (@planetarium/account) Added
Account.getAddress()async method. [#3084] - (@planetarium/account)
Address.deriveFrom()method now returnsPromise<Address>when anAccountis given. However, it still returnsAddresswhen aPublicKeyis given. [#3061] - (@planetarium/account-web3-secret-storage)
Web3KeyStoreno more implementsImportableKeyStore<KeyId, RawPrivateKey>. Instead, it now implementsImportableKeyStore<KeyId, Web3Account, Web3KeyMetadata>. [#3061, #3084] - (Libplanet.Explorer) Added
Indexfield toIBlockChainContextinterface. [#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 becameBytefromUInt. [#3085] - (Libplanet.Explorer)
currencyHashparameter was removed frombalanceandtotalSupplyinStateQuerytype. [#3085]
Added APIs
- Added
ITxInvoiceinterface. [[#1164], #2986] - Added
ITxSigningMetadatainterface. [[#1164], #2986] - Added
IUnsignedTxinterface. [[#1164], #2986] - Added
TxInvoiceclass. [[#1164], #2986] - Added
TxSigningMetadataclass. [[#1164], #2986] - Added
UnsignedTxclass. [[#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
Web3Accountclass. [#3061, #3084] - (@planetarium/account-web3-secret-storage) Added
Web3KeyObjectinterface. [#3061] - (Libplanet.Explorer) Added several interfaces and classes that pertain to
blockchain indexing. [#2613]
- Added
IBlockChainIndexinterface. - Added
IIndexingContextinterface. - Added
BlockChainIndexBaseabstract class. - Added
RocksDbBlockChainIndexclass. - Added
RocksDbIndexingContextclass. - Added
IndexingServiceclass. - Added
IndexMismatchExceptionclass.
- Added
- (Libplanet.Explorer.Cocona) New project was added to provide Cocona
commands related to Libplanet.Explorer project. [#2613]
- Added
IndexCommandCocona command class.
- Added
- (Libplanet.Explorer) Added
statesquery 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
DecryptionOptionsinterface. [#3071]- Added
Web3KeyStoreOptions.decryptionOptionsattribute.
- Added
- (@planetarium/account-web3-secret-storage) Added
WeakPrivateKeyErrorclass. [#3071] - (@planetarium/account-web3-secret-storage) Added
Web3KeyMetadatainterface. [#3084] - (Libplanet.Tools) Added
-v/--validator-keyoption toplanet block generate-genesiscommand. [#3088] - (Libplanet.Explorer) Added
CurrencyInputtype. [#3085] - (Libplanet.Explorer) Added
CurrencyInput-typedcurrencyparameter tobalanceandtotalSupplyinStateQuerytype. [#3085]
Behavioral changes
Added
TypeConverterto commonly-used types. [#2711, #3044]Addressnow can be converted from and tostringthroughTypeConverter.HashDigest<T>now can be converted from and tostringthroughTypeConverter.PublicKeynow can be converted from and tostringthroughTypeConverter.
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>.UpdatedAddressesnow preserves the order ofAddresses 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 thatAccountRetrievalinstance can be gathered without unlocking the account. Instead,PassphraseEntry.authenticate()is called when operations that require unlockingWeb3Accountare called, such assign()orgetPublicKey(). [#3061](Libplanet.Explorer) Now, when an
IBlockChainIndexinstance is available in the optionalIndexproperty of the injectedIBlockChainContextinstance, GraphQL queries can benefit from the improved lookup performance of the index. Applications willing to take advantage of the index should provide an instance ofIBlockChainIndexto theIBlockChainContextimplementation and add theIndexingServicehosted 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]BlockRefproperty ofTransactionTypenow usesIBlockChainIndexif available.transactionResultquery inTransactionQuerynow usesIBlockChainIndexif available.
(@planetarium/account-web3-secret-storage)
Web3KeyStorenow supports Scrypt as one of KDF functions besides PBKDF2. [#3071]
Bug fixes
- In
PreVoteblock 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]