testnet-v4.7.1: Merge pull request #3266 from ProvableHQ/history_optimization

history feature optimization