From 21b05fb03007897508e8f61ca3f4992662fc153a Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:09:46 +0200 Subject: [PATCH] make linter happy --- core/state_processor_test.go | 86 ++++++++++++++++++------------------ trie/verkle.go | 1 - 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/core/state_processor_test.go b/core/state_processor_test.go index 5a03ad124bd0..4d9f1db5dbea 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -498,49 +498,49 @@ func TestProcessVerkle(t *testing.T) { txCost1 := params.TxGas txCost2 := params.TxGas - contractCreationCost := intrinsicContractCreationGas + uint64( - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+params.WitnessBranchReadCost+params.WitnessBranchWriteCost+ /* creation */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* creation with value */ - 739 /* execution costs */) - codeWithExtCodeCopyGas := intrinsicCodeWithExtCodeCopyGas + uint64( - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+params.WitnessBranchReadCost+params.WitnessBranchWriteCost+ /* creation (tx) */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+params.WitnessBranchReadCost+params.WitnessBranchWriteCost+ /* creation (CREATE at pc=0x20) */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* write code hash */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #0 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #1 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #2 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #3 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #4 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #5 */ - params.WitnessChunkReadCost+ /* SLOAD in constructor */ - params.WitnessChunkWriteCost+ /* SSTORE in constructor */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+params.WitnessBranchReadCost+params.WitnessBranchWriteCost+ /* creation (CREATE at PC=0x121) */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* write code hash */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #0 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #1 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #2 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #3 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #4 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #5 */ - params.WitnessChunkReadCost+ /* SLOAD in constructor */ - params.WitnessChunkWriteCost+ /* SSTORE in constructor */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* write code hash for tx creation */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #0 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #1 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #2 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #3 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #4 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #5 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #6 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #7 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #8 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #9 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #10 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #11 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #12 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #13 */ - params.WitnessChunkReadCost+params.WitnessChunkWriteCost+ /* code chunk #14 */ - 4844 /* execution costs */) + contractCreationCost := intrinsicContractCreationGas + + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + /* creation */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* creation with value */ + 739 /* execution costs */ + codeWithExtCodeCopyGas := intrinsicCodeWithExtCodeCopyGas + + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + /* creation (tx) */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + /* creation (CREATE at pc=0x20) */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* write code hash */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #0 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #1 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #2 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #3 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #4 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #5 */ + params.WitnessChunkReadCost + /* SLOAD in constructor */ + params.WitnessChunkWriteCost + /* SSTORE in constructor */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + /* creation (CREATE at PC=0x121) */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* write code hash */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #0 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #1 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #2 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #3 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #4 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #5 */ + params.WitnessChunkReadCost + /* SLOAD in constructor */ + params.WitnessChunkWriteCost + /* SSTORE in constructor */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* write code hash for tx creation */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #0 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #1 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #2 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #3 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #4 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #5 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #6 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #7 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #8 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #9 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #10 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #11 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #12 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #13 */ + params.WitnessChunkReadCost + params.WitnessChunkWriteCost + /* code chunk #14 */ + 4844 /* execution costs */ blockGasUsagesExpected := []uint64{ txCost1*2 + txCost2, txCost1*2 + txCost2 + contractCreationCost + codeWithExtCodeCopyGas, diff --git a/trie/verkle.go b/trie/verkle.go index 808d16cd313c..120f19b9e779 100644 --- a/trie/verkle.go +++ b/trie/verkle.go @@ -455,7 +455,6 @@ func (t *VerkleTrie) UpdateContractCode(addr common.Address, codeHash common.Has } values[groupOffset] = chunks[i : i+32] - if groupOffset == 255 || len(chunks)-i <= 32 { err = t.UpdateStem(key[:31], values)