@@ -22,6 +22,6 @@ namespace Nethermind.Trie
     {
         public static long TrieNodeCacheMemory { get; set; } = 128.MB();
 
-        public static int TrieNodeCacheCount => (int)TrieNodeCacheMemory / PatriciaTree.OneNodeAvgMemoryEstimate;
+        public static long TrieNodeCacheCount => TrieNodeCacheMemory / PatriciaTree.OneNodeAvgMemoryEstimate;
     }
 }
//  Copyright (c) 2021 Demerzel Solutions Limited
//  This file is part of the Nethermind library.
// 
//  The Nethermind library is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
// 
//  The Nethermind library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//  GNU Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public License
//  along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.

using Nethermind.Core.Extensions;

namespace Nethermind.Trie
{
    public static class MemoryAllowance
    {
        public static long TrieNodeCacheMemory { get; set; } = 128.MB();

        public static int TrieNodeCacheCount => (int)TrieNodeCacheMemory / PatriciaTree.OneNodeAvgMemoryEstimate;
    }
}

should not the fix be: (int)(TrieNodeCacheMemory / PatriciaTree.OneNodeAvgMemoryEstimate) I would like to see the test showing how it was broken before and why it is fixed now anyway, love the fact that a simple thing was fixed fast