Skip to content

Commit

Permalink
fix gas costs
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Ballet <[email protected]>
  • Loading branch information
gballet committed Nov 5, 2024
1 parent 8101511 commit 544b460
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,11 @@ func TestProcessVerkle(t *testing.T) {
contractCreationCost := intrinsicContractCreationGas +
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + params.WitnessChunkFillCost + /* creation */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* creation with value */
739 /* execution costs */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #0 */
39 /* execution costs */
codeWithExtCodeCopyGas := intrinsicCodeWithExtCodeCopyGas +
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + params.WitnessChunkFillCost + /* creation (tx) */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* write code hash */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + params.WitnessChunkFillCost + /* creation (CREATE at pc=0x20) */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* write code hash */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #0 */
Expand All @@ -520,7 +522,7 @@ func TestProcessVerkle(t *testing.T) {
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #5 */
params.WitnessChunkReadCost + /* SLOAD in constructor */
params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* SSTORE in constructor */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + /* creation (CREATE at PC=0x121) */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessBranchReadCost + params.WitnessBranchWriteCost + params.WitnessChunkFillCost + /* creation (CREATE at PC=0x121) */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* write code hash */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #0 */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #1 */
Expand All @@ -546,7 +548,7 @@ func TestProcessVerkle(t *testing.T) {
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #12 */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #13 */
params.WitnessChunkReadCost + params.WitnessChunkWriteCost + params.WitnessChunkFillCost + /* code chunk #14 */
4844 /* execution costs */
4144 /* execution costs */
blockGasUsagesExpected := []uint64{
txCost1*2 + txCost2,
txCost1*2 + txCost2 + contractCreationCost + codeWithExtCodeCopyGas,
Expand Down

0 comments on commit 544b460

Please sign in to comment.