Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1427 remove refunds for selfdestruct #1442

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
package net.consensys.linea.zktracer.module.constants;

import java.math.BigInteger;
import java.nio.MappedByteBuffer;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;

import net.consensys.linea.zktracer.ColumnHeader;

/**
* WARNING: This code is generated automatically.
Expand Down Expand Up @@ -320,8 +326,7 @@ public class GlobalConstants {
public static final int PHASE_RIPEMD_RESULT = 0x4;
public static final int PHASE_SHA2_DATA = 0x1;
public static final int PHASE_SHA2_RESULT = 0x2;
public static final int REFUND_CONST_R_SCLEAR = 0x3a98;
public static final int REFUND_CONST_R_SELFDESTRUCT = 0x5dc0;
public static final int REFUND_CONST_R_SCLEAR = 0x12c0;
public static final int RLP_ADDR_RECIPE_1 = 0x1;
public static final int RLP_ADDR_RECIPE_2 = 0x2;
public static final int RLP_PREFIX_INT_LONG = 0xb7;
Expand Down Expand Up @@ -356,4 +361,42 @@ public class GlobalConstants {
public static final int WCP_INST_LEQ = 0xf;
public static final int WORD_SIZE = 0x20;
public static final int WORD_SIZE_MO = 0x1f;

private final BitSet filled = new BitSet();
private int currentLine = 0;

static List<ColumnHeader> headers(int length) {
List<ColumnHeader> headers = new ArrayList<>();
return headers;
}

public GlobalConstants(List<MappedByteBuffer> buffers) {}

public int size() {
if (!filled.isEmpty()) {
throw new RuntimeException("Cannot measure a trace with a non-validated row.");
}

return this.currentLine;
}

public GlobalConstants validateRow() {
filled.clear();
this.currentLine++;

return this;
}

public GlobalConstants fillAndValidateRow() {
filled.clear();
this.currentLine++;

return this;
}

public void build() {
if (!filled.isEmpty()) {
throw new IllegalStateException("Cannot build trace with a non-validated row.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public enum GasConstants {
G_S_SET(GlobalConstants.GAS_CONST_G_SSET),
G_S_RESET(GlobalConstants.GAS_CONST_G_SRESET),
R_S_CLEAR(GlobalConstants.REFUND_CONST_R_SCLEAR),
R_SELF_DESTRUCT(GlobalConstants.REFUND_CONST_R_SELFDESTRUCT),
G_SELF_DESTRUCT(GlobalConstants.GAS_CONST_G_SELFDESTRUCT),
G_CREATE(GlobalConstants.GAS_CONST_G_CREATE),
G_CODE_DEPOSIT(GlobalConstants.GAS_CONST_G_CODE_DEPOSIT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,4 @@ public long accountCreation() {
return 0L;
}
}

@Override
public long refund() {
return GlobalConstants.REFUND_CONST_R_SELFDESTRUCT;
}
}
Loading