From 3e6989e4f1b333305b4cc195508af2e0b4661d60 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 15 Nov 2023 16:23:58 +0900 Subject: [PATCH] Changelog --- CHANGES.md | 11 ++++++++++- Libplanet.Store/HashNodeCache.cs | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f1f4b2599dd..6e3c6beb161 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,8 @@ To be released. `PrivateKey` and `PublicKey`. [[#3486]] - (Libplanet.Crypto) Added `Address` property to `PrivateKey` and `PublicKey`. [[#3486]] + - (Libplanet.Store) Added optional `cache` parameter of type `HashNodeCache` + to `MerkleTrie()` constructors. [[#3489]] ### Backward-incompatible network protocol changes @@ -33,8 +35,13 @@ To be released. ### Added APIs + - (Libplanet.Store) Added `HashNodeCache` class. [[#3489]] + ### Behavioral changes + - Changed internal caching strategy of `TrieStateStore` for read/write + optimization. [[#3489]] + ### Bug fixes ### Dependencies @@ -45,9 +52,11 @@ To be released. [#3480]: https://github.com/planetarium/libplanet/pull/3480 [#3485]: https://github.com/planetarium/libplanet/pull/3485 [#3486]: https://github.com/planetarium/libplanet/pull/3486 +[#3487]: https://github.com/planetarium/libplanet/pull/3487 +[#3489]: https://github.com/planetarium/libplanet/pull/3489 [`RocksDb`]: https://www.nuget.org/packages/RocksDB [`RocksDBSharp`]: https://www.nuget.org/packages/Planetarium.RocksDbSharp -[#3487]: https://github.com/planetarium/libplanet/pull/3487 + Version 3.7.0 ------------- diff --git a/Libplanet.Store/HashNodeCache.cs b/Libplanet.Store/HashNodeCache.cs index dfe962fefea..02db81f3ee1 100644 --- a/Libplanet.Store/HashNodeCache.cs +++ b/Libplanet.Store/HashNodeCache.cs @@ -15,7 +15,7 @@ namespace Libplanet.Store public class HashNodeCache { // FIXME: Tuned to 9c mainnet. Should be refactored to accept cache size as an argument. - private const int _cahceSize = 1_048_576; + private const int _cacheSize = 1_048_576; private const int _reportPeriod = 60_000; private LruCache, IValue> _cache; @@ -26,7 +26,7 @@ public class HashNodeCache internal HashNodeCache() { - _cache = new LruCache, IValue>(_cahceSize); + _cache = new LruCache, IValue>(_cacheSize); _stopwatch = new Stopwatch(); _attempts = 0; _hits = 0;