From 72b2402a17d23fbbc9e91782391da87e546a53ea Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Sun, 26 Feb 2023 14:22:18 -0600 Subject: [PATCH] Explicitly set deposit contract nonce --- pulse/deposit_contract.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pulse/deposit_contract.go b/pulse/deposit_contract.go index 8ee1ed619..127c338bd 100644 --- a/pulse/deposit_contract.go +++ b/pulse/deposit_contract.go @@ -58,17 +58,14 @@ func replaceDepositContract(state *state.StateDB) { state.SetCode(ethereumDepositContractAddr, nilContractBytes) log.Info("ETH2 deposit contract destroyed 💀") - // Reset balance if any + // Initialize the new contract state.SetBalance(pulseDepositContractAddr, uint256.NewInt(0)) - - // Initialise zero hash array in the new deposit contract + state.SetCode(pulseDepositContractAddr, depositContractBytes) + state.SetNonce(pulseDepositContractAddr, 0) for i := 0; i < len(depositContractStorage); i++ { hash := common.HexToHash(depositContractStorage[i][0]) value := common.HexToHash(depositContractStorage[i][1]) state.SetState(pulseDepositContractAddr, hash, value) } - - // Deploy the new contract code - state.SetCode(pulseDepositContractAddr, depositContractBytes) log.Info("Deployed new beacon deposit contract ✨", "address", pulseDepositContractAddr) }