From 2e87576245aac1845eeddb4ca95847e0be1e7839 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Mon, 1 Mar 2021 09:08:36 -0700 Subject: [PATCH] Reduce hash calculations in Bonsai Tries (#1960) Setting contract code on a bonsai account results in a re-hashing. To reduce this only set the code if the code was changed. In some cases this was responsible for 40% of load. Signed-off-by: Danno Ferrin --- .../besu/ethereum/bonsai/BonsaiWorldStateUpdater.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateUpdater.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateUpdater.java index 03d7764ab4..24d37d6346 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateUpdater.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateUpdater.java @@ -217,7 +217,9 @@ public class BonsaiWorldStateUpdater extends AbstractWorldUpdater