From 891ec7fef619cac0a796e3e29d5b2d4c095bdd9b Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Tue, 13 Jun 2023 02:32:57 -0400 Subject: [PATCH] Use `big.Int#Set` instead of `big.Int#SetBytes` when possible (#896) There is no reason to make the bytes transformation and back to big int to assign a big int to another one. The `Set` method should be used instead. --- core/state_transition.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 39e23f3ecb08c..c9a650b1bf36c 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -381,8 +381,8 @@ func (st *StateTransition) TransitionDb(interruptCtx context.Context) (*Executio if !st.noFeeBurnAndTip { st.state.AddBalance(st.evm.Context.Coinbase, amount) - output1 := new(big.Int).SetBytes(input1.Bytes()) - output2 := new(big.Int).SetBytes(input2.Bytes()) + output1 := new(big.Int).Set(input1) + output2 := new(big.Int).Set(input2) // Deprecating transfer log and will be removed in future fork. PLEASE DO NOT USE this transfer log going forward. Parameters won't get updated as expected going forward with EIP1559 // add transfer log